More judicious Wordpress-to-WordPress correction, to avoid bungling reasonable URLs. fixes #13971

git-svn-id: https://develop.svn.wordpress.org/trunk@15377 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2010-07-08 19:35:29 +00:00
parent 9d381db2cb
commit 15b414837c
2 changed files with 14 additions and 2 deletions
+13 -1
View File
@@ -2825,8 +2825,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 );
}
?>