Ticket #6992: 6992.2.diff
File 6992.2.diff, 2.3 KB (added by , 16 years ago) |
---|
-
wp-includes/compat.php
96 96 return implode( '', $chars ); 97 97 } 98 98 99 function php_compat_htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) 100 { 101 // Sanity check 102 if (!is_scalar($string)) { 103 user_error('htmlspecialchars_decode() expects parameter 1 to be string, ' .gettype($string) . ' given', E_USER_WARNING); 104 return; 105 } 106 107 if (!is_int($quote_style) && $quote_style !== null) { 108 user_error('htmlspecialchars_decode() expects parameter 2 to be integer, ' .gettype($quote_style) . ' given', E_USER_WARNING); 109 return; 110 } 111 112 // Init 113 $from = array('&', '<', '>'); 114 $to = array('&', '<', '>'); 115 116 if ($quote_style & ENT_QUOTES) { 117 $from[] = '"'; 118 $to[] = '"'; 119 $from[] = '''; 120 $to[] = "'"; 121 } elseif ($quote_style & ENT_COMPAT) { 122 $from[] = '"'; 123 $to[] = '"'; 124 } 125 return str_replace($from, $to, $string); 126 } 127 128 if (!function_exists('htmlspecialchars_decode')) { 129 function htmlspecialchars_decode($string, $quote_style = null) 130 { 131 return php_compat_htmlspecialchars_decode($string, $quote_style); 132 } 133 } 99 134 ?> -
wp-includes/comment-template.php
818 818 } else if ( empty($comment_author) ) { 819 819 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post->ID)); 820 820 } else { 821 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date", $post->ID, $comment_author, $comment_author_email));821 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date", $post->ID, htmlspecialchars_decode($comment_author, ENT_QUOTES), $comment_author_email)); 822 822 } 823 823 824 824 // keep $comments for legacy's sake