diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index c7325043b2..1bd8ac1e44 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -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', diff --git a/phpBB/phpbb/storage/storage.php b/phpBB/phpbb/storage/storage.php index 545f342e82..25c81075c4 100644 --- a/phpBB/phpbb/storage/storage.php +++ b/phpBB/phpbb/storage/storage.php @@ -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)