From e76c8695e15ac3648e65f267a86329e092a6b555 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 17 Apr 2006 23:33:08 +0000 Subject: [PATCH] Escape single quotes in options.php. fixes #2656 git-svn-id: https://develop.svn.wordpress.org/trunk@3710 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/options.php | 2 +- wp-includes/functions-formatting.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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);