Escape single quotes in options.php. fixes #2656

git-svn-id: https://develop.svn.wordpress.org/trunk@3710 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-04-17 23:33:08 +00:00
parent 6c81ba3cab
commit e76c8695e1
2 changed files with 3 additions and 1 deletions

View File

@ -95,7 +95,7 @@ default:
$options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name");
foreach ($options as $option) :
$value = wp_specialchars($option->option_value);
$value = wp_specialchars($option->option_value, 'single');
echo "
<tr>
<th scope='row'><label for='$option->option_name'>$option->option_name</label></th>

View File

@ -103,6 +103,8 @@ function wp_specialchars( $text, $quotes = 0 ) {
$text = str_replace('>', '&gt;', $text);
if ( 'double' === $quotes ) {
$text = str_replace('"', '&quot;', $text);
} elseif ( 'single' === $quotes ) {
$text = str_replace("'", '&#039;', $text);
} elseif ( $quotes ) {
$text = str_replace('"', '&quot;', $text);
$text = str_replace("'", '&#039;', $text);