diff --git a/wp-admin/options.php b/wp-admin/options.php index 5e479e45d7..9b44a7c0ab 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -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 " diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 7480deeb68..63731a5b05 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -103,6 +103,8 @@ function wp_specialchars( $text, $quotes = 0 ) { $text = str_replace('>', '>', $text); if ( 'double' === $quotes ) { $text = str_replace('"', '"', $text); + } elseif ( 'single' === $quotes ) { + $text = str_replace("'", ''', $text); } elseif ( $quotes ) { $text = str_replace('"', '"', $text); $text = str_replace("'", ''', $text);