r77619 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77618‎ | r77619 | r77620 >
Date:00:08, 3 December 2010
Author:simetrical
Status:ok
Tags:
Comment:
Remove language="JavaScript"

Pointed out by mah at bug 209 comment 14. The attribute is and always
has been ignored by browsers, and it also makes validators complain.
The correct thing to use is Html::inlineScript(), which will also omit
the equally useless (but required by XHTML 1) type="text/javascript",
but I didn't do that here because maybe someone is using the extension
with old MediaWiki versions, and it makes no real difference.
Modified paths:
  • /trunk/extensions/DismissableSiteNotice/DismissableSiteNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DismissableSiteNotice/DismissableSiteNotice.php
@@ -23,18 +23,18 @@
2424
2525 // No dismissal for anons
2626 if ( $wgUser->isAnon() ) {
27 - $notice = <<<EOT
28 -<script type="text/javascript" language="JavaScript">
 27+ $notice = <<<HTML
 28+<script type="text/javascript">
2929 /* <![CDATA[ */
3030 document.writeln("$encNotice");
3131 /* ]]> */
3232 </script>
33 -EOT;
 33+HTML;
3434 return true;
3535 }
3636
37 - $notice = <<<EOT
38 -<script type="text/javascript" language="JavaScript">
 37+ $notice = <<<HTML
 38+<script type="text/javascript">
3939 /* <![CDATA[ */
4040 var cookieName = "dismissSiteNotice=";
4141 var cookiePos = document.cookie.indexOf(cookieName);
@@ -65,7 +65,7 @@
6666 }
6767 /* ]]> */
6868 </script>
69 -EOT;
 69+HTML;
7070 // Compact the string a bit
7171 /*
7272 $notice = strtr( $notice, array(

Status & tagging log