Don't allow high control chars in titles on non-utf8 wikis
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 16 May 2003 13:36:37 +0000 (13:36 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 16 May 2003 13:36:37 +0000 (13:36 +0000)
includes/Title.php

index 9c0f6d2..e171eb5 100644 (file)
@@ -68,7 +68,13 @@ class Title {
 
        function legalChars()
        {
-               return "-,.()' &;%!?_0-9A-Za-z\\/:\\x80-\\xFF";
+               global $wgInputEncoding;
+               if( $wgInputEncoding == "utf-8" ) {
+                       return "-,.()' &;%!?_0-9A-Za-z\\/:\\x80-\\xFF";
+               } else {
+                       # ISO 8859-* don't allow 0x80-0x9F
+                       return "-,.()' &;%!?_0-9A-Za-z\\/:\\xA0-\\xFF";
+               }
        }
 
        function getInterwikiLink( $key )