aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2017-03-25 11:30:13 +0100
committerMarc Alexander <admin@m-a-styles.de>2017-03-25 11:30:13 +0100
commitbf6822ed1b327b902bb689380ffe4277b52b75b2 (patch)
treec5d2b58df5146829e771184f0c8f25c2c14aeb4a /phpBB/phpbb
parente86f199d165367440d376453b2480f5ba3bff34f (diff)
parent27ab639fbea160af2a003cb6ce3b2394195da297 (diff)
downloadforums-bf6822ed1b327b902bb689380ffe4277b52b75b2.tar
forums-bf6822ed1b327b902bb689380ffe4277b52b75b2.tar.gz
forums-bf6822ed1b327b902bb689380ffe4277b52b75b2.tar.bz2
forums-bf6822ed1b327b902bb689380ffe4277b52b75b2.tar.xz
forums-bf6822ed1b327b902bb689380ffe4277b52b75b2.zip
Merge pull request #4750 from rubencm/ticket/15134
[ticket/15134] Replace php native functions for filesystem service methods
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/avatar/driver/upload.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php
index 2640e1ad1e..4effa4c410 100644
--- a/phpBB/phpbb/avatar/driver/upload.php
+++ b/phpBB/phpbb/avatar/driver/upload.php
@@ -281,12 +281,20 @@ class upload extends \phpbb\avatar\driver\driver
);
extract($this->dispatcher->trigger_event('core.avatar_driver_upload_delete_before', compact($vars)));
- if (!sizeof($error) && file_exists($filename))
+ if (!sizeof($error) && $this->filesystem->exists($filename))
{
- @unlink($filename);
+ try
+ {
+ $this->filesystem->remove($filename);
+ return true;
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Fail is covered by return statement below
+ }
}
- return true;
+ return false;
}
/**
@@ -304,6 +312,6 @@ class upload extends \phpbb\avatar\driver\driver
*/
protected function can_upload()
{
- return (file_exists($this->phpbb_root_path . $this->config['avatar_path']) && $this->filesystem->is_writable($this->phpbb_root_path . $this->config['avatar_path']) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on'));
+ return ($this->filesystem->exists($this->phpbb_root_path . $this->config['avatar_path']) && $this->filesystem->is_writable($this->phpbb_root_path . $this->config['avatar_path']) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on'));
}
}