1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-25 00:36:12 +02:00

[ticket/15253] Fix exception route

PHPBB3-15253
This commit is contained in:
Rubén Calvo 2017-06-25 17:01:22 +02:00
parent 0d14c85630
commit afb804fe1e

View File

@ -14,7 +14,7 @@
namespace phpbb\storage\adapter; namespace phpbb\storage\adapter;
use phpbb\storage\exception\exception; use phpbb\storage\exception\exception;
use phpbb\filesystem\filesystem_exception; use phpbb\filesystem\exception\filesystem_exception;
class local implements adapter_interface class local implements adapter_interface
{ {
@ -31,10 +31,10 @@ class local implements adapter_interface
/** /**
* Constructor * Constructor
*/ */
public function __construct(\phpbb\config\config $config, \phpbb\filesystem\filesystem $filesystem, $root_path, $path_key) public function __construct(\phpbb\config\config $config, \phpbb\filesystem\filesystem $filesystem, $phpbb_root_path, $path_key)
{ {
$this->filesystem = $filesystem; $this->filesystem = $filesystem;
$this->root_path = $root_path.$config[$path_key]; $this->root_path = $phpbb_root_path.$config[$path_key];
if(substr($this->root_path, -1, 1) != DIRECTORY_SEPARATOR) if(substr($this->root_path, -1, 1) != DIRECTORY_SEPARATOR)
{ {
@ -47,7 +47,7 @@ class local implements adapter_interface
*/ */
public function put_contents($path, $content) public function put_contents($path, $content)
{ {
if ($this->exists($this->root_path.$path)) if ($this->exists($path))
{ {
throw new exception('', $path); // FILE_EXISTS throw new exception('', $path); // FILE_EXISTS
} }
@ -67,7 +67,7 @@ class local implements adapter_interface
*/ */
public function get_contents($path) public function get_contents($path)
{ {
if (!$this->exists($this->root_path.$path)) if (!$this->exists($path))
{ {
throw new exception('', $path); // FILE_DONT_EXIST throw new exception('', $path); // FILE_DONT_EXIST
} }