]> git.mxchange.org Git - friendica.git/commitdiff
Remove deprecated rdirname() in favor of native dirname()
authornupplaPhil <admin@philipp.info>
Sat, 4 Jan 2020 23:10:34 +0000 (00:10 +0100)
committernupplaPhil <admin@philipp.info>
Sat, 4 Jan 2020 23:10:34 +0000 (00:10 +0100)
boot.php
src/App/BaseURL.php

index fa99a7bb3922a062fc0f7c6b834f83cdeba3be8e..8ce33b2bdf5ef76ac610311df4ddcc31cd84c049 100644 (file)
--- 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);
-       }
-}
index 6b79fad4662e6c0c88ad6bb18d457c79ad033e16..7c286514a6206e46747da3def5e3d62486f166d0 100644 (file)
@@ -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, '/');