aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_convert.php
diff options
context:
space:
mode:
authorRichard Foote <dicky@phpbb.com>2012-01-02 13:09:21 -0500
committerRichard Foote <dicky@phpbb.com>2012-01-02 13:09:21 -0500
commit24cf7f1d29bdfba636d9692a02188b9cddba4e1f (patch)
tree860e88608518bd8ad2b8d595328b1cbbe39b94e6 /phpBB/includes/functions_convert.php
parentd5dc70cbe3be0f18666a0dc7e972b9d6766291af (diff)
downloadforums-24cf7f1d29bdfba636d9692a02188b9cddba4e1f.tar
forums-24cf7f1d29bdfba636d9692a02188b9cddba4e1f.tar.gz
forums-24cf7f1d29bdfba636d9692a02188b9cddba4e1f.tar.bz2
forums-24cf7f1d29bdfba636d9692a02188b9cddba4e1f.tar.xz
forums-24cf7f1d29bdfba636d9692a02188b9cddba4e1f.zip
[ticket/10407] Fix check for empty image paths in convertor
This applies to avatar_path,avatar_gallery_path,smilies_path and upload_path. Currently, the convertor gets each path from the config table and adds a trailing slash. If there is no entry in the config table for the path, the path can never be empty because of the added trailing slash. This patch will check the path without the trailing slash to see if the path is actually empty. PHPBB3-10407
Diffstat (limited to 'phpBB/includes/functions_convert.php')
-rw-r--r--phpBB/includes/functions_convert.php24
1 files changed, 8 insertions, 16 deletions
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 4663fe46cc..3b26f417e9 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -424,10 +424,8 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false
$relative_path = empty($convert->convertor['source_path_absolute']);
- // strip trailing slash
- $trimmed_avatar_gallery_path = rtrim($convert->convertor['avatar_gallery_path'], '/');
-
- if (empty($trimmed_avatar_gallery_path))
+ // check for trailing slash
+ if (rtrim($convert->convertor['avatar_gallery_path'], '/') === '')
{
$convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_GALLERY_PATH'], 'import_avatar_gallery()'), __LINE__, __FILE__);
}
@@ -591,10 +589,8 @@ function import_attachment($source, $use_target = false)
global $convert, $phpbb_root_path, $config, $user;
- // strip trailing slash
- $trimmed_upload_path = rtrim($convert->convertor['upload_path'], '/');
-
- if (empty($trimmed_upload_path))
+ // check for trailing slash
+ if (rtrim($convert->convertor['upload_path'], '/') === '')
{
$convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_UPLOAD_DIR'], 'import_attachment()'), __LINE__, __FILE__);
}
@@ -653,10 +649,8 @@ function import_smiley($source, $use_target = false)
global $convert, $phpbb_root_path, $config, $user;
- // strip trailing slash
- $trimmed_smilies_path = rtrim($convert->convertor['smilies_path'], '/');
-
- if (empty($trimmed_smilies_path))
+ // check for trailing slash
+ if (rtrim($convert->convertor['smilies_path'], '/') === '')
{
$convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_SMILIES_PATH'], 'import_smiley()'), __LINE__, __FILE__);
}
@@ -676,10 +670,8 @@ function import_avatar($source, $use_target = false, $user_id = false)
global $convert, $phpbb_root_path, $config, $user;
- // strip trailing slash
- $trimmed_avatar_path = rtrim($convert->convertor['avatar_path'], '/');
-
- if (empty($trimmed_avatar_path))
+ // check for trailing slash
+ if (rtrim($convert->convertor['avatar_path'], '/') === '')
{
$convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_AVATAR_PATH'], 'import_avatar()'), __LINE__, __FILE__);
}