mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/15342] Check if is resource before close it
PHPBB3-15342
This commit is contained in:
parent
bdf3a0c913
commit
0cc77d2c99
3 changed files with 18 additions and 3 deletions
|
@ -187,7 +187,10 @@ class acp_database
|
||||||
|
|
||||||
$storage->write_stream($file, $fp);
|
$storage->write_stream($file, $fp);
|
||||||
|
|
||||||
fclose($fp);
|
if (is_resource($fp))
|
||||||
|
{
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
$storage->track_file($file);
|
$storage->track_file($file);
|
||||||
|
|
||||||
|
|
|
@ -246,8 +246,14 @@ class upload
|
||||||
{
|
{
|
||||||
// Move the thumbnail from temp folder to the storage
|
// Move the thumbnail from temp folder to the storage
|
||||||
$fp = fopen($destination, 'rb');
|
$fp = fopen($destination, 'rb');
|
||||||
|
|
||||||
$this->storage->write_stream($destination_name, $fp);
|
$this->storage->write_stream($destination_name, $fp);
|
||||||
fclose($fp);
|
|
||||||
|
if (is_resource($fp))
|
||||||
|
{
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
$this->storage->track_file($destination_name);
|
$this->storage->track_file($destination_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -445,8 +445,14 @@ class filespec_storage
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$fp = fopen($this->filename, 'rb');
|
$fp = fopen($this->filename, 'rb');
|
||||||
|
|
||||||
$storage->write_stream($this->destination_file, $fp);
|
$storage->write_stream($this->destination_file, $fp);
|
||||||
fclose($fp);
|
|
||||||
|
if (is_resource($fp))
|
||||||
|
{
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
$storage->track_file($this->destination_file);
|
$storage->track_file($this->destination_file);
|
||||||
}
|
}
|
||||||
catch (\phpbb\storage\exception\exception $e)
|
catch (\phpbb\storage\exception\exception $e)
|
||||||
|
|
Loading…
Add table
Reference in a new issue