Commit 35adff9f authored by Philip_Clarke's avatar Philip_Clarke Committed by bgm

Issue #1440754 : provide option to fallback on SymLinksIfOwnerMatch if hosting...

Issue #1440754 : provide option to fallback on SymLinksIfOwnerMatch if hosting disables FollowSymLinks
parent a0b4fc50
......@@ -39,7 +39,7 @@ function boost_admin_htaccess_settings() {
);
$form['htaccess']['boost_server_name_http_host'] = array(
'#type' => 'radios',
'#title' => t('Servers URL or Name'),
'#title' => t("Server's URL or Name"),
'#default_value' => variable_get('boost_server_name_http_host', BOOST_SERVER_NAME_HTTP_HOST),
'#options' => array(
'%{HTTP_HOST}' => '%{HTTP_HOST}',
......@@ -123,6 +123,16 @@ function boost_admin_htaccess_settings() {
'#default_value' => variable_get('boost_charset_type', BOOST_CHARSET_TYPE),
'#description' => t('Depending on your i18n settings you might want this disabled or enabled.'),
);
$form['htaccess']['boost_match_symlinks_options'] = array(
'#type' => 'radios',
'#title' => t('%cache_folder Options', array( '%cache_folder' => $document_root . '/' . variable_get('boost_root_cache_dir', BOOST_ROOT_CACHE_DIR) . '/' . variable_get('boost_normal_dir', BOOST_NORMAL_DIR) . '/' . variable_get('boost_server_name_http_host', BOOST_SERVER_NAME_HTTP_HOST) . '/.htaccess' )),
'#default_value' => variable_get('boost_match_symlinks_options', BOOST_MATCH_SYMLINKS_OPTIONS),
'#options' => array(
1 => 'Set "Options +FollowSymLinks"',
0 => 'Set "Options +SymLinksIfOwnerMatch"',
),
'#description' => t('The .htaccess file in the cache folder requires "Options +FollowSymLinks" or "Options +SymLinksIfOwnerMatch" for mod_rewrite. Some hosting companies only permit the SymLinksIfOwnerMatch option. If you get a http 500 error code try setting SymLinksIfOwnerMatch.'),
);
// reset htaccess on submit;
$form['#submit'][] = 'boost_form_submit_handler';
......
......@@ -82,6 +82,12 @@ define('BOOST_VISIBILITY_LISTED', 1);
*/
define('BOOST_VISIBILITY_PHP', 2);
/**
* Default Setting for .htaccess files +FollowSymLinks, some ISP's require
* +SymlinksIfOwnerMatch to avoid http 500 error.
*/
define('BOOST_MATCH_SYMLINKS_OPTIONS', 1);
/**
* Implements hook_menu().
*/
......@@ -1511,7 +1517,7 @@ function boost_htaccess_cache_dir_generate() {
$string .= "\n";
$string .= "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006\n";
$string .= "Options None\n";
$string .= "Options +FollowSymLinks\n";
$string .= "Options +" . ( variable_get('boost_match_symlinks_options', BOOST_MATCH_SYMLINKS_OPTIONS) ? "FollowSymLinks" : "SymLinksIfOwnerMatch" ) . "\n";
$string .= "\n";
return $string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment