mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/15253] Update imports
PHPBB3-15253
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
namespace phpbb\template;
|
||||
|
||||
use phpbb\filesystem\helper as filesystem_helper;
|
||||
|
||||
class asset
|
||||
{
|
||||
protected $components = array();
|
||||
@@ -153,7 +155,7 @@ class asset
|
||||
public function set_path($path, $urlencode = false)
|
||||
{
|
||||
// Since 1.7.0 Twig returns the real path of the file. We need it to be relative.
|
||||
$real_root_path = \phpbb\filesystem\helper::realpath($this->path_helper->get_phpbb_root_path()) . DIRECTORY_SEPARATOR;
|
||||
$real_root_path = filesystem_helper::realpath($this->path_helper->get_phpbb_root_path()) . DIRECTORY_SEPARATOR;
|
||||
|
||||
// If the asset is under the phpBB root path we need to remove its path and then prepend $phpbb_root_path
|
||||
if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path)
|
||||
@@ -163,7 +165,7 @@ class asset
|
||||
else
|
||||
{
|
||||
// Else we make the path relative to the current working directory
|
||||
$real_root_path = \phpbb\filesystem\helper::realpath('.') . DIRECTORY_SEPARATOR;
|
||||
$real_root_path = filesystem_helper::realpath('.') . DIRECTORY_SEPARATOR;
|
||||
if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path)
|
||||
{
|
||||
$path = str_replace('\\', '/', substr($path, strlen($real_root_path)));
|
||||
|
Reference in New Issue
Block a user