From 19a6c4373ef0c19f82a74aec9dc3399275764738 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Sun, 8 Sep 2013 17:25:59 +0200 Subject: [PATCH] [-] IN : Remove warnings when safe_mode open_basedir missconfigured --- install-dev/upgrade/php/move_translations_module_file.php | 4 ++-- .../upgrade/php/p15015_blockadvertising_extension.php | 4 ++-- install-dev/upgrade/php/update_genders_images.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/install-dev/upgrade/php/move_translations_module_file.php b/install-dev/upgrade/php/move_translations_module_file.php index 0fcf7e49f..fa2239a72 100644 --- a/install-dev/upgrade/php/move_translations_module_file.php +++ b/install-dev/upgrade/php/move_translations_module_file.php @@ -51,7 +51,7 @@ function move_translations_module_file() { // Name for the old file and the new file $old_file = _PS_MODULE_DIR_.$module_name.'/'.$lang['iso_code'].'.php'; - if (!file_exists($old_file)) + if (!@file_exists($old_file)) continue; $dir_translations = _PS_MODULE_DIR_.$module_name.'/translations/'; @@ -61,7 +61,7 @@ function move_translations_module_file() if (!is_dir($dir_translations)) $res &= mkdir($dir_translations, 0777); - if (!rename($old_file, $new_file)) + if (!@rename($old_file, $new_file)) { $error_list[] = $module_name.' - '.$lang['iso_code']."
\r\n"; $res &= false; diff --git a/install-dev/upgrade/php/p15015_blockadvertising_extension.php b/install-dev/upgrade/php/p15015_blockadvertising_extension.php index d7795f6b6..aa23cd093 100644 --- a/install-dev/upgrade/php/p15015_blockadvertising_extension.php +++ b/install-dev/upgrade/php/p15015_blockadvertising_extension.php @@ -30,8 +30,8 @@ function p15015_blockadvertising_extension() define('_PS_ROOT_DIR_', realpath(INSTALL_PATH.'/../')); // Try to update with the extension of the image that exists in the module directory - if (file_exists(_PS_ROOT_DIR_.'modules/blockadvertising')) - foreach (scandir(_PS_ROOT_DIR_.'modules/blockadvertising') as $file) + if (@file_exists(_PS_ROOT_DIR_.'modules/blockadvertising')) + foreach (@scandir(_PS_ROOT_DIR_.'modules/blockadvertising') as $file) if (in_array($file, array('advertising.jpg', 'advertising.gif', 'advertising.png'))) Db::getInstance()->execute(' REPLACE INTO `'._DB_PREFIX_.'configuration` (name, value) diff --git a/install-dev/upgrade/php/update_genders_images.php b/install-dev/upgrade/php/update_genders_images.php index 20b060356..4d21e9542 100644 --- a/install-dev/upgrade/php/update_genders_images.php +++ b/install-dev/upgrade/php/update_genders_images.php @@ -26,12 +26,12 @@ function update_genders_images() { - if (file_exists(_PS_ROOT_DIR_.'/img/genders/Mr.jpg')) + if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Mr.jpg')) @rename(_PS_ROOT_DIR_.'/img/genders/Mr.jpg', _PS_ROOT_DIR_.'/img/genders/1.jpg'); - if (file_exists(_PS_ROOT_DIR_.'/img/genders/Ms.jpg')) + if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Ms.jpg')) @rename(_PS_ROOT_DIR_.'/img/genders/Ms.jpg', _PS_ROOT_DIR_.'/img/genders/2.jpg'); - if (file_exists(_PS_ROOT_DIR_.'/img/genders/Miss.jpg')) + if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Miss.jpg')) @rename(_PS_ROOT_DIR_.'/img/genders/Miss.jpg', _PS_ROOT_DIR_.'/img/genders/3.jpg'); - if (file_exists(_PS_ROOT_DIR_.'genders/unknown.jpg')) + if (@file_exists(_PS_ROOT_DIR_.'genders/unknown.jpg')) @rename(_PS_ROOT_DIR_.'/img/genders/unknown.jpg', _PS_ROOT_DIR_.'/img/genders/Unknown.jpg'); } \ No newline at end of file