output escaping
This commit is contained in:
Crack
2010-08-06 15:17:53 +02:00
parent bcaec73441
commit e6170b2dc2
3 changed files with 25 additions and 10 deletions

View File

@@ -246,7 +246,7 @@ function display_input($path, $name, $description = '', $type, $value, $value_is
} }
if (isset($opts['setvalue']) && $opts['setvalue']) { if (isset($opts['setvalue']) && $opts['setvalue']) {
?> ?>
<a class="set-value" href="#<?php echo "$path={$opts['setvalue']}" ?>" title="<?php echo sprintf(__('Set value: %s'), htmlspecialchars($opts['setvalue'])) ?>" style="display:none"><img alt="set-value" src="<?php echo $img_path ?>b_edit.png" width="16" height="16" /></a> <a class="set-value" href="#<?php echo htmlspecialchars("$path={$opts['setvalue']}") ?>" title="<?php echo sprintf(__('Set value: %s'), htmlspecialchars($opts['setvalue'])) ?>" style="display:none"><img alt="set-value" src="<?php echo $img_path ?>b_edit.png" width="16" height="16" /></a>
<?php <?php
} }
if (isset($opts['show_restore_default']) && $opts['show_restore_default']) { if (isset($opts['show_restore_default']) && $opts['show_restore_default']) {

View File

@@ -70,10 +70,3 @@ if (!$cfgRelation['userconfigwork']) {
$msg = PMA_sanitize(sprintf($msg, '[a@./Documentation.html#linked-tables@_blank]', '[/a]')); $msg = PMA_sanitize(sprintf($msg, '[a@./Documentation.html#linked-tables@_blank]', '[/a]'));
PMA_Message::notice($msg)->display(); PMA_Message::notice($msg)->display();
} }
if (isset($error) && $error) {
if (!$error instanceof PMA_Message) {
$error = PMA_Message::error($error);
}
$error->display();
}

View File

@@ -8,6 +8,13 @@
/** /**
* Common initialization for user preferences modification pages * Common initialization for user preferences modification pages
*
* @uses ConfigFile::getInstance()
* @uses ConfigFile::resetConfigData()
* @uses ConfigFile::setAllowedKeys()
* @uses ConfigFile::setCfgUpdateReadMapping()
* @uses ConfigFile::updateWithGlobalConfig()
* @uses PMA_read_userprefs_fieldnames()
*/ */
function PMA_userprefs_pageinit() function PMA_userprefs_pageinit()
{ {
@@ -30,6 +37,7 @@ function PMA_userprefs_pageinit()
* * type - 'db' (config read from pmadb) or 'session' (read from user session) * * type - 'db' (config read from pmadb) or 'session' (read from user session)
* *
* @uses $_SESSION['userconfig'] * @uses $_SESSION['userconfig']
* @uses $GLOBALS['controllink']
* @uses PMA_array_merge_recursive * @uses PMA_array_merge_recursive
* @uses PMA_backquote() * @uses PMA_backquote()
* @uses PMA_DBI_fetch_single_row() * @uses PMA_DBI_fetch_single_row()
@@ -69,9 +77,11 @@ function PMA_load_userprefs()
/** /**
* Saves user preferences * Saves user preferences
* *
* @uses $GLOBALS['controllink'] * @uses $_SESSION['cache'][...]['userprefs']
* @uses $_SESSION['cache']['userprefs']
* @uses $_SESSION['userconfig'] * @uses $_SESSION['userconfig']
* @uses $GLOBALS['cfg']['ServerDefault']
* @uses $GLOBALS['controllink']
* @uses $GLOBALS['server']
* @uses ConfigFile::getConfigArray() * @uses ConfigFile::getConfigArray()
* @uses ConfigFile::getInstance() * @uses ConfigFile::getInstance()
* @uses PMA_backquote() * @uses PMA_backquote()
@@ -207,6 +217,7 @@ function PMA_read_userprefs_fieldnames(array $forms = null)
* *
* No validation is done! * No validation is done!
* *
* @uses PMA_load_userprefs()
* @uses PMA_save_userprefs() * @uses PMA_save_userprefs()
* @param string $cfg_name * @param string $cfg_name
* @param mixed $value * @param mixed $value
@@ -230,6 +241,10 @@ function PMA_persist_option($path, $value, $default_value)
/** /**
* Redirects after saving new user preferences * Redirects after saving new user preferences
* *
* @uses ConfigFile::getConfigArray()
* @uses ConfigFile::getInstance()
* @uses PMA_generate_common_url()
* @uses PMA_sendHeaderLocation()
* @param array $forms * @param array $forms
* @param array $old_settings * @param array $old_settings
* @param string $file_name * @param string $file_name
@@ -269,6 +284,13 @@ function PMA_userprefs_redirect(array $forms, array $old_settings, $file_name, $
. PMA_generate_common_url($url_params, '&') . $hash); . PMA_generate_common_url($url_params, '&') . $hash);
} }
/**
* Shows form which allows to quickly load settings stored in browser's local storage
*
* @uses $_REQUEST['prefs_autoload']
* @uses $_SESSION['userprefs_autoload']
* @uses PMA_generate_common_hidden_inputs()
*/
function PMA_userprefs_autoload_header() function PMA_userprefs_autoload_header()
{ {
if (isset($_REQUEST['prefs_autoload']) && $_REQUEST['prefs_autoload'] == 'hide') { if (isset($_REQUEST['prefs_autoload']) && $_REQUEST['prefs_autoload'] == 'hide') {