aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorMateBartus <mate.bartus@gmail.com>2015-03-12 00:25:00 +0100
committerMateBartus <mate.bartus@gmail.com>2015-04-16 13:24:10 +0200
commit4bdef6fd21a5dcab455b0cd1ee2652de606929c3 (patch)
tree33eae92e90b43770b2c1e2e4508dbcf35d6bd7da /phpBB/includes/functions_posting.php
parentf86c5d905bb82967505ef3e07fa429b59c112871 (diff)
downloadforums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.tar
forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.tar.gz
forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.tar.bz2
forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.tar.xz
forums-4bdef6fd21a5dcab455b0cd1ee2652de606929c3.zip
[ticket/13697] Moving filesystem related functions to filesystem service
* Moving filesystem service to \phpbb\filesystem namespace * Wraping Symfony's Filesystem component * Moving filesystem related functions from includes/functions.php into \phpbb\filesystem\filesystem Functions moved (and deprecated): - phpbb_chmod - phpbb_is_writable - phpbb_is_absolute - phpbb_own_realpath - phpbb_realpath * Adding interface for filesystem service PHPBB3-13697
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 9c6ddffe9f..4233395574 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -407,14 +407,14 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
global $auth, $user, $config, $db, $cache;
- global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_filesystem;
$filedata = array(
'error' => array()
);
include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
- $upload = new fileupload();
+ $upload = new fileupload($phpbb_filesystem);
if ($config['check_attachment_content'] && isset($config['mime_triggers']))
{
@@ -668,7 +668,7 @@ function get_supported_image_types($type = false)
*/
function create_thumbnail($source, $destination, $mimetype)
{
- global $config;
+ global $config, $phpbb_filesystem;
$min_filesize = (int) $config['img_min_thumb_filesize'];
$img_filesize = (file_exists($source)) ? @filesize($source) : false;
@@ -820,7 +820,14 @@ function create_thumbnail($source, $destination, $mimetype)
return false;
}
- phpbb_chmod($destination, CHMOD_READ | CHMOD_WRITE);
+ try
+ {
+ $this->filesystem->phpbb_chmod($destination, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
return true;
}