mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/15305] Throw exception if stream_copy_to_stream() fail
PHPBB3-15305
This commit is contained in:
parent
98ad1e4971
commit
d89df35959
2 changed files with 5 additions and 1 deletions
|
@ -735,6 +735,7 @@ $lang = array_merge($lang, array(
|
||||||
'STORAGE_CANNOT_DELETE' => 'Can not delete file or folder.',
|
'STORAGE_CANNOT_DELETE' => 'Can not delete file or folder.',
|
||||||
'STORAGE_CANNOT_RENAME' => 'Can not rename file or folder.',
|
'STORAGE_CANNOT_RENAME' => 'Can not rename file or folder.',
|
||||||
'STORAGE_CANNOT_COPY' => 'Can not copy file or folder.',
|
'STORAGE_CANNOT_COPY' => 'Can not copy file or folder.',
|
||||||
|
'STORAGE_CANNOT_COPY_RESOURCE' => 'Can not copy resource.',
|
||||||
'STORAGE_CANNOT_CREATE_DIR' => 'Can not create directory.',
|
'STORAGE_CANNOT_CREATE_DIR' => 'Can not create directory.',
|
||||||
'STORAGE_CANNOT_OPEN_FILE' => 'Can not open file.',
|
'STORAGE_CANNOT_OPEN_FILE' => 'Can not open file.',
|
||||||
'STORAGE_CANNOT_CREATE_FILE' => 'Can not create file.',
|
'STORAGE_CANNOT_CREATE_FILE' => 'Can not create file.',
|
||||||
|
|
|
@ -229,6 +229,9 @@ class local implements adapter_interface, stream_interface
|
||||||
throw new exception('STORAGE_CANNOT_CREATE_FILE', $path);
|
throw new exception('STORAGE_CANNOT_CREATE_FILE', $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_copy_to_stream($resource, $stream);
|
if (stream_copy_to_stream($resource, $stream) === false)
|
||||||
|
{
|
||||||
|
throw new exception('STORAGE_CANNOT_COPY_RESOURCE');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue