[Pkg-mediawiki-commits] r358 - mediawiki/experimental/debian/patches

Thorsten Glaser tg at alioth.debian.org
Thu Jul 26 14:06:33 UTC 2012


Author: tg
Date: 2012-07-26 14:06:32 +0000 (Thu, 26 Jul 2012)
New Revision: 358

Modified:
   mediawiki/experimental/debian/patches/fix_invalid_xhtml.patch
Log:
another few cases


Modified: mediawiki/experimental/debian/patches/fix_invalid_xhtml.patch
===================================================================
--- mediawiki/experimental/debian/patches/fix_invalid_xhtml.patch	2012-07-26 13:54:47 UTC (rev 357)
+++ mediawiki/experimental/debian/patches/fix_invalid_xhtml.patch	2012-07-26 14:06:32 UTC (rev 358)
@@ -2,6 +2,8 @@
 
 Fix invalid XHTML:
 • someone forgot to check whether HTML5 was enabled before toying around
+• let makeLink and all its callers remove HTML5-only attributes from
+  hyperlinks if someone else was not careful (rather, several someones)
 
 --- a/includes/HTMLForm.php
 +++ b/includes/HTMLForm.php
@@ -23,3 +25,26 @@
  			if ( isset( $this->mParams[$param] ) ) {
  				$attribs[$param] = $this->mParams[$param];
  			}
+--- a/includes/SkinTemplate.php
++++ b/includes/SkinTemplate.php
+@@ -1613,6 +1613,8 @@ abstract class BaseTemplate extends Quic
+ 	 *   output a <span> instead of just text.
+ 	 */
+ 	function makeLink( $key, $item, $options = array() ) {
++		global $wgHtml5;
++
+ 		if ( isset( $item['text'] ) ) {
+ 			$text = $item['text'];
+ 		} else {
+@@ -1664,6 +1666,11 @@ abstract class BaseTemplate extends Quic
+ 					$attrs['class'] = $options['link-class'];
+ 				}
+ 			}
++			if ( !$wgHtml5 ) {
++				foreach ( array( 'context', 'primary' ) as $k ) {
++					unset( $attrs[$k] );
++				}
++			}
+ 			$html = Html::rawElement( isset( $attrs['href'] ) ? 'a' : $options['link-fallback'], $attrs, $html );
+ 		}
+ 




More information about the Pkg-mediawiki-commits mailing list