From: Emmanuel Engelhart Date: Sun, 10 Oct 2004 21:30:17 +0000 (+0000) Subject: + checkUnicodeCompliantBrowser() and code to show if necessary a warning message X-Git-Tag: 1.5.0alpha1~1609 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=154571e1927cfca9ced803ec12a1cc4cc36acd24;p=lhc%2Fweb%2Fwiklou.git + checkUnicodeCompliantBrowser() and code to show if necessary a warning message --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 67ea7ca700..e362e3c5fb 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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; + } + } ?>