mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
Merge branch 'ticket/17296' into ticket/17296-master
This commit is contained in:
@@ -38,6 +38,9 @@ class path_helper
|
||||
/** @var string */
|
||||
protected $web_root_path;
|
||||
|
||||
/** @var bool Flag whether we're in adm path */
|
||||
protected $in_adm_path = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -114,7 +117,13 @@ class path_helper
|
||||
$path = substr($path, 8);
|
||||
}
|
||||
|
||||
return filesystem_helper::clean_path($web_root_path . $path);
|
||||
$path = filesystem_helper::clean_path($web_root_path . $path);
|
||||
|
||||
// Further clean path if we're in adm
|
||||
if ($this->in_adm_path && str_starts_with($path, $this->phpbb_root_path . $this->adm_relative_path))
|
||||
{
|
||||
$path = substr($path, strlen($this->phpbb_root_path . $this->adm_relative_path));
|
||||
}
|
||||
}
|
||||
|
||||
return $path;
|
||||
@@ -178,6 +187,11 @@ class path_helper
|
||||
return $this->web_root_path = filesystem_helper::clean_path('./../' . $this->phpbb_root_path);
|
||||
}
|
||||
|
||||
if ($path_info === '/' && defined('ADMIN_START') && preg_match('/\/' . preg_quote($this->adm_relative_path, '/') . 'index\.' . $this->php_ext . '$/', $script_name))
|
||||
{
|
||||
$this->in_adm_path = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the path info is empty (single /), then we're not using
|
||||
* a route like app.php/foo/bar
|
||||
|
Reference in New Issue
Block a user