From: Conrad Irwin Date: Mon, 21 Jun 2010 14:08:46 +0000 (+0000) Subject: (bug 18431) Remove initial whitespace from fragment in Title::secureAndSplit() X-Git-Tag: 1.31.0-rc.0~36425 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=58793052afcc03a630e4e1b3a52897c564a8555c;p=lhc%2Fweb%2Fwiklou.git (bug 18431) Remove initial whitespace from fragment in Title::secureAndSplit() --- diff --git a/includes/Title.php b/includes/Title.php index 62a083a8f1..e096eb8e39 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2563,7 +2563,7 @@ class Title { } $fragment = strstr( $dbkey, '#' ); if ( false !== $fragment ) { - $this->setFragment( $fragment ); + $this->setFragment( preg_replace( '/^#_*/', '#', $fragment ) ); $dbkey = substr( $dbkey, 0, strlen( $dbkey ) - strlen( $fragment ) ); # remove whitespace again: prevents "Foo_bar_#" # becoming "Foo_bar_"