* (bug 11143) Links containing invalid UTF-8 percent-code sequences are now
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 23 Aug 2009 00:45:36 +0000 (00:45 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 23 Aug 2009 00:45:36 +0000 (00:45 +0000)
  cleanly disabled instead of breaking parsing entirely on PHP 5.2.

This was fixed as a side-effect of r55382 for bug 15248; adding comments
in Title::secureAndSplit nothing this.

RELEASE-NOTES
includes/Title.php

index 47dce9a..dc333bf 100644 (file)
@@ -412,6 +412,8 @@ this. Was used when mwEmbed was going to be an extension.
 * (bug 15248) Non-breaking spaces and certain other Unicode space characters
   are now normalized to ordinary spaces in titles; if your wiki has existing
   titles with such characters, run cleanupTitles.php and/or cleanupImages.php
+* (bug 11143) Links containing invalid UTF-8 percent-code sequences are now
+  cleanly disabled instead of breaking parsing entirely on PHP 5.2.
 * (bug 20296) Fixed an PHP warning in Language::getMagic() in PHP 5.3
 * When creating accounts, don't prefill name from current username (which
   presumably is already taken)
index 51a9c17..d65e2ac 100644 (file)
@@ -2241,6 +2241,9 @@ class Title {
                $dbkey = preg_replace( '/\xE2\x80[\x8E\x8F\xAA-\xAE]/S', '', $dbkey );
 
                # Clean up whitespace
+               # Note: use of the /u option on preg_replace here will cause
+               # input with invalid UTF-8 sequences to be nullified out in PHP 5.2.x,
+               # conveniently disabling them.
                #
                $dbkey = preg_replace( '/[ _\xA0\x{1680}\x{180E}\x{2000}-\x{200B}\x{2028}\x{2029}\x{202F}\x{205F}\x{3000}]+/u', '_', $dbkey );
                $dbkey = trim( $dbkey, '_' );