aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/avatar/driver/upload.php16
-rw-r--r--phpBB/phpbb/version_helper.php10
2 files changed, 17 insertions, 9 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'));
}
}
diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php
index f80d2b16fc..fb330df26f 100644
--- a/phpBB/phpbb/version_helper.php
+++ b/phpBB/phpbb/version_helper.php
@@ -181,7 +181,7 @@ class version_helper
$self = $this;
$current_version = $this->current_version;
- // Filter out any versions less than to the current version
+ // Filter out any versions less than the current version
$versions = array_filter($versions, function($data) use ($self, $current_version) {
return $self->compare($data['current'], $current_version, '>=');
});
@@ -215,7 +215,7 @@ class version_helper
$self = $this;
$current_version = $this->current_version;
- // Filter out any versions less than to the current version
+ // Filter out any versions less than the current version
$versions = array_filter($versions, function($data) use ($self, $current_version) {
return $self->compare($data['current'], $current_version, '>=');
});
@@ -245,7 +245,7 @@ class version_helper
*
* @param bool $force_update Ignores cached data. Defaults to false.
* @param bool $force_cache Force the use of the cache. Override $force_update.
- * @return string
+ * @return array
* @throws version_check_exception
*/
public function get_suggested_updates($force_update = false, $force_cache = false)
@@ -266,7 +266,7 @@ class version_helper
*
* @param bool $force_update Ignores cached data. Defaults to false.
* @param bool $force_cache Force the use of the cache. Override $force_update.
- * @return string Version info
+ * @return array Version info
* @throws version_check_exception
*/
public function get_versions_matching_stability($force_update = false, $force_cache = false)
@@ -286,7 +286,7 @@ class version_helper
*
* @param bool $force_update Ignores cached data. Defaults to false.
* @param bool $force_cache Force the use of the cache. Override $force_update.
- * @return string Version info, includes stable and unstable data
+ * @return array Version info, includes stable and unstable data
* @throws version_check_exception
*/
public function get_versions($force_update = false, $force_cache = false)