+ checkUnicodeCompliantBrowser() and code to show if necessary a warning message
authorEmmanuel Engelhart <kelson42@users.mediawiki.org>
Sun, 10 Oct 2004 21:30:17 +0000 (21:30 +0000)
committerEmmanuel Engelhart <kelson42@users.mediawiki.org>
Sun, 10 Oct 2004 21:30:17 +0000 (21:30 +0000)
includes/EditPage.php

index 67ea7ca..e362e3c 100644 (file)
@@ -13,6 +13,7 @@
  *
  * @package MediaWiki
  */
+
 class EditPage {
        var $mArticle;
        var $mTitle;
@@ -126,6 +127,7 @@ class EditPage {
                global $wgAllowAnonymousMinor;
                global $wgWhitelistEdit;
                global $wgSpamRegex, $wgFilterCallback;
+               global $wgUseLatin1;
 
                $sk = $wgUser->getSkin();
                $isConflict = false;
@@ -291,6 +293,10 @@ class EditPage {
                                }
                        }
                        $wgOut->setPageTitle( $s );
+                       if ( !$wgUseLatin1 && !$this->checkUnicodeCompliantBrowser() ) {
+                               $this->mArticle->setOldSubtitle();
+                               $wgOut->addWikiText( wfMsg( 'nonunicodebrowser') );
+                       }
                        if ( $this->oldid ) {
                                $this->mArticle->setOldSubtitle();
                                $wgOut->addHTML( wfMsg( 'editingold' ) );
@@ -633,6 +639,19 @@ htmlspecialchars( $wgContLang->recodeForEdit( $this->textbox1 ) ) .
                        return false;
                }
        }
+
+
+       function checkUnicodeCompliantBrowser() {
+               global $wgBrowserBlackList;
+               $currentbrowser = $_SERVER["HTTP_USER_AGENT"];
+               foreach ( $wgBrowserBlackList as $browser ) {
+                       if ( preg_match($browser, $currentbrowser) ) {
+                               return false;
+                       }
+               }
+               return true;
+       }
+
 }
 
 ?>