* Avoid notice warning on edit with no User-Agent header
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 22 Oct 2005 20:27:26 +0000 (20:27 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 22 Oct 2005 20:27:26 +0000 (20:27 +0000)
RELEASE-NOTES
includes/EditPage.php

index bb8e79b..2efccbd 100644 (file)
@@ -162,6 +162,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 2981) Linktrail for Tamil (ta)
 * (bug 3722) Update of Arabic language (ar) Namespace changes
 * Wrap message page insertions in a transaction to speed up installation
+* Avoid notice warning on edit with no User-Agent header
 
 
 === Caveats ===
index aca158c..ec2d749 100644 (file)
@@ -1131,9 +1131,19 @@ END
                }
        }
 
-
+       /**
+        * Check if the browser is on a blacklist of user-agents known to
+        * mangle UTF-8 data on form submission. Returns true if Unicode
+        * should make it through, false if it's known to be a problem.
+        * @return bool
+        * @access private
+        */
        function checkUnicodeCompliantBrowser() {
                global $wgBrowserBlackList;
+               if( empty( $_SERVER["HTTP_USER_AGENT"] ) ) {
+                       // No User-Agent header sent? Trust it by default...
+                       return true;
+               }
                $currentbrowser = $_SERVER["HTTP_USER_AGENT"];
                foreach ( $wgBrowserBlackList as $browser ) {
                        if ( preg_match($browser, $currentbrowser) ) {