mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/15692] Check if argument is a valid resource
PHPBB3-15692
This commit is contained in:
parent
071d5fe997
commit
5fbe929a1d
2 changed files with 6 additions and 0 deletions
|
@ -745,6 +745,7 @@ $lang = array_merge($lang, array(
|
|||
'STORAGE_CANNOT_CREATE_DIR' => 'Can not create directory.',
|
||||
'STORAGE_CANNOT_OPEN_FILE' => 'Can not open file.',
|
||||
'STORAGE_CANNOT_CREATE_FILE' => 'Can not create file.',
|
||||
'STORAGE_INVALID_RESOURCE' => 'Resource is invalid.',
|
||||
|
||||
'TB' => 'TB',
|
||||
'TERMS_LINK' => 'Terms',
|
||||
|
|
|
@ -271,6 +271,11 @@ class storage
|
|||
throw new exception('STORAGE_FILE_EXISTS', $path);
|
||||
}
|
||||
|
||||
if (!is_resource($resource))
|
||||
{
|
||||
throw new exception('STORAGE_INVALID_RESOURCE');
|
||||
}
|
||||
|
||||
$adapter = $this->get_adapter();
|
||||
|
||||
if ($adapter instanceof stream_interface)
|
||||
|
|
Loading…
Add table
Reference in a new issue