[-] Classes: Tools::generateHtaccess() can be called without its arguments (use default configuration settings)

This commit is contained in:
rMalie
2011-12-29 10:54:48 +00:00
parent 8ce8f166e1
commit b5240ce83f
5 changed files with 28 additions and 81 deletions
+15 -2
View File
@@ -1493,10 +1493,23 @@ class ToolsCore
return self::getHttpHost();
}
public static function generateHtaccess($path, $rewrite_settings, $cache_control, $specific = '', $disable_multiviews = false)
public static function generateHtaccess($path = null, $rewrite_settings = null, $cache_control = null, $specific = '', $disable_multiviews = null)
{
if (defined('PS_INSTALLATION_IN_PROGRESS'))
return;
return true;
if (!Configuration::get('PS_REWRITING_SETTINGS'))
return true;
// Default values for parameters
if (is_null($path))
$path = _PS_ROOT_DIR_.'/.htaccess';
if (is_null($rewrite_settings))
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS');
if (is_null($cache_control))
$cache_control = (int)Configuration::get('PS_HTACCESS_CACHE_CONTROL');
if (is_null($disable_multiviews))
$disable_multiviews = (int)Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS');
// Check current content of .htaccess and save all code outside of prestashop comments
$specific_before = $specific_after = '';