mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-28 10:09:15 +02:00
[ticket/15305] Fix streams
PHPBB3-15305
This commit is contained in:
parent
9b7a5fc2a5
commit
cd2bae63cb
@ -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)
|
||||
{
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user