mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/15692] Check if argument is a valid resource
PHPBB3-15692
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user