diff --git a/phpBB/phpbb/storage/adapter/local.php b/phpBB/phpbb/storage/adapter/local.php index 4c822d3a5e..479f8d990e 100644 --- a/phpBB/phpbb/storage/adapter/local.php +++ b/phpBB/phpbb/storage/adapter/local.php @@ -201,7 +201,7 @@ class local implements adapter_interface */ public function read_stream($path) { - $stream = @fopen($path, 'rb'); + $stream = @fopen($this->root_path . $path, 'rb'); if (!$stream) { @@ -221,7 +221,7 @@ class local implements adapter_interface throw new exception('STORAGE_FILE_EXISTS', $path); } - $stream = @fopen($path, 'w+b'); + $stream = @fopen($this->root_path . $path, 'w+b'); if (!$stream) { diff --git a/tests/storage/adapter/local_test.php b/tests/storage/adapter/local_test.php index 0eeb3f2b31..e31f507c4f 100644 --- a/tests/storage/adapter/local_test.php +++ b/tests/storage/adapter/local_test.php @@ -106,7 +106,7 @@ public function test_read_stream() { file_put_contents($this->path . 'file.txt', ''); - $stream = $this->adapter->read_stream($this->path . 'file.txt'); + $stream = $this->adapter->read_stream('file.txt'); $this->assertTrue(is_resource($stream)); fclose($stream); unlink($this->path . 'file.txt'); @@ -116,7 +116,7 @@ { file_put_contents($this->path . 'file.txt', 'abc'); $stream = fopen($this->path . 'file.txt', 'r'); - $this->adapter->write_stream($this->path . 'file2.txt', $stream); + $this->adapter->write_stream('file2.txt', $stream); fclose($stream); $this->assertEquals(file_get_contents($this->path . 'file2.txt'), 'abc'); unlink($this->path . 'file.txt');