From 6c3770875d07c30e9cde35edd70cdeb524831e9c Mon Sep 17 00:00:00 2001 From: SamBrishes Date: Sun, 28 Jun 2020 11:06:12 +0200 Subject: [PATCH] Fix for issue #1216 Fix for issue #1216 --- bl-kernel/admin/views/settings.php | 2 +- bl-kernel/helpers/text.class.php | 5 +++-- bl-kernel/url.class.php | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php index ca3ef219..695d569c 100644 --- a/bl-kernel/admin/views/settings.php +++ b/bl-kernel/admin/views/settings.php @@ -1,6 +1,6 @@ -'jsform', 'class'=>'tab-content')); ?> +'jsform', 'class'=>'tab-content', 'action'=>'settings.php')); ?>
diff --git a/bl-kernel/helpers/text.class.php b/bl-kernel/helpers/text.class.php index 2a53cebd..a8fa0d0d 100644 --- a/bl-kernel/helpers/text.class.php +++ b/bl-kernel/helpers/text.class.php @@ -102,8 +102,9 @@ class Text { public static function endsWith($string, $endsString) { - //$length = (-1)*self::length($endsString); - return (mb_substr($string, -1)===$endsString); + $length = self::length($endsString); + + return (mb_substr($string, -$length)===$endsString); } public static function endsWithNumeric($string) diff --git a/bl-kernel/url.class.php b/bl-kernel/url.class.php index 43b6bbda..79c968d3 100644 --- a/bl-kernel/url.class.php +++ b/bl-kernel/url.class.php @@ -78,6 +78,10 @@ class Url } elseif (!empty($this->slug) && ($filterURI=='/')) { $this->setWhereAmI('page'); } elseif ($filterName=='admin') { + if (Text::endsWith($this->uri, '.php')) { + $this->uri = mb_substr($this->uri, 0, -4); + $this->slug = mb_substr($this->slug, 0, -4); + } $this->slug = ltrim($this->slug, '/'); }