aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/avatar
diff options
context:
space:
mode:
authorRubén Calvo <rubencm@gmail.com>2017-03-19 17:29:11 +0100
committerRubén Calvo <rubencm@gmail.com>2017-03-19 17:29:11 +0100
commit018528b0623dab807c478e2bd3345606faa95ba3 (patch)
tree91966d36071bced677b05fa952aaebf8c471111e /phpBB/phpbb/avatar
parente497937dd437796148556241f045ac9480b4a675 (diff)
downloadforums-018528b0623dab807c478e2bd3345606faa95ba3.tar
forums-018528b0623dab807c478e2bd3345606faa95ba3.tar.gz
forums-018528b0623dab807c478e2bd3345606faa95ba3.tar.bz2
forums-018528b0623dab807c478e2bd3345606faa95ba3.tar.xz
forums-018528b0623dab807c478e2bd3345606faa95ba3.zip
[ticket/15134] Replace php native functions for filesystem service methods
PHPBB3-15134
Diffstat (limited to 'phpBB/phpbb/avatar')
-rw-r--r--phpBB/phpbb/avatar/driver/upload.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php
index 2640e1ad1e..93b2353098 100644
--- a/phpBB/phpbb/avatar/driver/upload.php
+++ b/phpBB/phpbb/avatar/driver/upload.php
@@ -281,9 +281,13 @@ 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);
+ }
+ catch(\phpbb\filesystem\exception\filesystem_exception $e) {}
}
return true;
@@ -304,6 +308,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'));
}
}