X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/699231ae09f7057a4d0000cdf32e50a3df6a04ca..a01a150d87a096c70b6ec80332b7ce89c943eefe:/wp-includes/formatting.php diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 0004673c..3d203e6f 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2236,7 +2236,8 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) { // Replace ampersands and single quotes only when displaying. if ( 'display' == $_context ) { - $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); + $url = wp_kses_normalize_entities( $url ); + $url = str_replace( '&', '&', $url ); $url = str_replace( "'", ''', $url ); } @@ -2825,8 +2826,20 @@ function sanitize_text_field($str) { * * @since 3.0.0 */ + function capital_P_dangit( $text ) { - return str_replace( 'Wordpress', 'WordPress', $text ); + // Simple replacement for titles + if ( 'the_title' === current_filter() ) + return str_replace( 'Wordpress', 'WordPress', $text ); + // Still here? Use the more judicious replacement + static $dblq = false; + if ( false === $dblq ) + $dblq = _x('“', 'opening curly quote'); + return str_replace( + array( ' Wordpress', '‘Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ), + array( ' WordPress', '‘WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ), + $text ); + } ?>