diff --git a/libraries/config.default.php b/libraries/config.default.php index a0cd97eed..4524cb268 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -2324,8 +2324,7 @@ $cfg['disable'] = array( 'UseDbSearch' => false, 'QueryHistoryDB' => false, 'ShowPhpInfo' => false, - 'ShowChgPassword' => false -); + 'ShowChgPassword' => false); //----------------------------------------------------------------------------- // custom-setup by mkkeck: 2004-05-04 diff --git a/libraries/config/FormDisplay.class.php b/libraries/config/FormDisplay.class.php index 464655226..7f9f56613 100644 --- a/libraries/config/FormDisplay.class.php +++ b/libraries/config/FormDisplay.class.php @@ -328,8 +328,12 @@ class FormDisplay 'doc' => $this->getDocLink($system_path), 'wiki' => $this->getWikiLink($system_path), 'show_restore_default' => $show_restore_default, - 'userprefs_allow' => $userprefs_allow, - 'userprefs_comment' => PMA_lang_name($system_path, 'cmt', '')); + 'userprefs_allow' => $userprefs_allow); + $comment = PMA_lang_name($system_path, 'cmt', ''); + if ($cf->getDefault('disable/' . $system_path) === false) { + $comment .= ($comment ? "\n" : '') . __('Users can disable this option'); + } + $opts['userprefs_comment'] = $comment; if (isset($form->default[$system_path])) { $opts['setvalue'] = $form->default[$system_path]; } diff --git a/libraries/config/FormDisplay.tpl.php b/libraries/config/FormDisplay.tpl.php index ef3b39b3b..db20bbb95 100644 --- a/libraries/config/FormDisplay.tpl.php +++ b/libraries/config/FormDisplay.tpl.php @@ -141,7 +141,7 @@ function display_input($path, $name, $description = '', $type, $value, $value_is $field_class .= ($field_class == '' ? '' : ' ') . ($has_errors ? 'custom field-error' : 'custom'); } $field_class = $field_class ? ' class="' . $field_class . '"' : ''; - $name_id = 'name="' . $path . '" id="' . $path . '"'; + $name_id = 'name="' . htmlspecialchars($path) . '" id="' . htmlspecialchars($path) . '"'; $tr_class = $_FormDisplayGroup ? ' class="group-field"' : ''; if (isset($opts['setvalue']) && $opts['setvalue'] == ':group') { unset($opts['setvalue']); @@ -182,6 +182,9 @@ function display_input($path, $name, $description = '', $type, $value, $value_is . ' value="' . htmlspecialchars($value) . '" />'; break; case 'checkbox': + if (strpos($path, 'disable-') === 0) { + echo ' '; + } echo ''; break; diff --git a/libraries/config/config_functions.lib.php b/libraries/config/config_functions.lib.php index 1d42c19cd..3b0e60662 100644 --- a/libraries/config/config_functions.lib.php +++ b/libraries/config/config_functions.lib.php @@ -66,9 +66,6 @@ function PMA_lang($lang_key) */ function PMA_lang_name($canonical_path, $type = 'name', $default = 'key') { - if ($type == 'name' && strpos($canonical_path, 'disable/') === 0) { - return __('Disable') . ': ' . lcfirst(PMA_lang_name(substr($canonical_path, 8), $type, $default)); - } $lang_key = str_replace( array('Servers/1/', 'disable/', '/'), array('Servers/', '', '_'),