kopia lustrzana https://github.com/friendica/friendica
Remove deprecated rdirname() in favor of native dirname()
rodzic
5d20cd7e16
commit
07b4ceecd2
19
boot.php
19
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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, '/');
|
||||
|
|
Ładowanie…
Reference in New Issue