From 07b4ceecd2cd8a7087366aa48744924f593bc622 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sun, 5 Jan 2020 00:10:34 +0100 Subject: [PATCH] Remove deprecated rdirname() in favor of native dirname() --- boot.php | 19 ------------------- src/App/BaseURL.php | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/boot.php b/boot.php index fa99a7bb39..8ce33b2bdf 100644 --- a/boot.php +++ b/boot.php @@ -683,22 +683,3 @@ function validate_include(&$file) // Simply return flag return $valid; } - -/** - * PHP 5 compatible dirname() with count parameter - * - * @see http://php.net/manual/en/function.dirname.php#113193 - * - * @deprecated with PHP 7 - * @param string $path - * @param int $levels - * @return string - */ -function rdirname($path, $levels = 1) -{ - if ($levels > 1) { - return dirname(rdirname($path, --$levels)); - } else { - return dirname($path); - } -} diff --git a/src/App/BaseURL.php b/src/App/BaseURL.php index 6b79fad466..7c286514a6 100644 --- a/src/App/BaseURL.php +++ b/src/App/BaseURL.php @@ -355,7 +355,7 @@ class BaseURL if (!empty($relative_script_path)) { // Module if (!empty($this->server['QUERY_STRING'])) { - $this->urlPath = trim(rdirname($relative_script_path, substr_count(trim($this->server['QUERY_STRING'], '/'), '/') + 1), '/'); + $this->urlPath = trim(dirname($relative_script_path, substr_count(trim($this->server['QUERY_STRING'], '/'), '/') + 1), '/'); } else { // Root page $this->urlPath = trim($relative_script_path, '/');