1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 14:30:32 +02:00

[ticket/15253] Move storage helper to filesystem

PHPBB3-15253
This commit is contained in:
Rubén Calvo
2017-06-27 10:27:32 +02:00
parent 8dbbf74550
commit 603a8c51da
24 changed files with 43 additions and 607 deletions

View File

@@ -153,7 +153,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\storage\helper::realpath($this->path_helper->get_phpbb_root_path()) . DIRECTORY_SEPARATOR;
$real_root_path = \phpbb\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 +163,7 @@ class asset
else
{
// Else we make the path relative to the current working directory
$real_root_path = \phpbb\storage\helper::realpath('.') . DIRECTORY_SEPARATOR;
$real_root_path = \phpbb\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)));

View File

@@ -49,7 +49,7 @@ class loader extends \Twig_Loader_Filesystem
*/
public function addSafeDirectory($directory)
{
$directory = \phpbb\storage\helper::realpath($directory);
$directory = \phpbb\filesystem\helper::realpath($directory);
if ($directory !== false)
{
@@ -89,7 +89,7 @@ class loader extends \Twig_Loader_Filesystem
*/
public function addPath($path, $namespace = self::MAIN_NAMESPACE)
{
return parent::addPath(\phpbb\storage\helper::realpath($path), $namespace);
return parent::addPath(\phpbb\filesystem\helper::realpath($path), $namespace);
}
/**
@@ -129,7 +129,7 @@ class loader extends \Twig_Loader_Filesystem
// can now check if we're within a "safe" directory
// Find the real path of the directory the file is in
$directory = \phpbb\storage\helper::realpath(dirname($file));
$directory = \phpbb\filesystem\helper::realpath(dirname($file));
if ($directory === false)
{