r109756 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109755‎ | r109756 | r109757 >
Date:20:46, 22 January 2012
Author:daniel
Status:ok
Tags:
Comment:
reverting r109723 because of slush.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Sanitizer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -26,9 +26,6 @@
2727 * (bug 32239) Removed wgEnableTooltipsAndAccesskeys.
2828 * Removed $wgVectorShowVariantName.
2929 * Removed $wgExtensionAliasesFiles. Use wgExtensionMessagesFiles.
30 -* Introduced $wgAllowATag to allow <a> tags to be used for external links,
31 - so rel and ref attributes can be used with microdata resp RDFa.
32 - Defaults is false.
3330
3431 === New features in 1.19 ===
3532 * (bug 19838) Possibility to get all interwiki prefixes if the interwiki
Index: trunk/phase3/includes/Sanitizer.php
@@ -407,11 +407,6 @@
408408 $htmlsingleonly[] = 'img';
409409 }
410410
411 - global $wgAllowATag;
412 - if ( $wgAllowATag ) {
413 - $htmlpairsStatic[] = 'a';
414 - }
415 -
416411 $htmlsingleallowed = array_unique( array_merge( $htmlsingle, $tabletags ) );
417412 $htmlelementsStatic = array_unique( array_merge( $htmlsingle, $htmlpairsStatic, $htmlnest ) );
418413
@@ -802,23 +797,6 @@
803798 }
804799 }
805800
806 - if ( $attribute === 'href' || $attribute === 'src' ) {
807 - if ( !preg_match( $hrefExp, $value ) ) {
808 - continue; //drop any href or src attributes not using an allowed protocol.
809 - //NOTE: this also drops all relative URLs
810 - }
811 - }
812 -
813 - //RDFa properties allow URIs. check them
814 - if ( $attribute === 'rel' || $attribute === 'rev' ||
815 - $attribute === 'about' || $attribute === 'property' || $attribute === 'resource' ||
816 - $attribute === 'datatype' || $attribute === 'typeof' ) {
817 - //Paranoia. Allow "simple" values but suppress javascript
818 - if ( preg_match( '/(^|\s)javascript\s*:/i', $value ) ) {
819 - continue;
820 - }
821 - }
822 -
823801 // If this attribute was previously set, override it.
824802 // Output should only have one attribute of each name.
825803 $out[$attribute] = $value;
@@ -1594,7 +1572,7 @@
15951573 'td' => array_merge( $common, $tablecell, $tablealign ),
15961574 'th' => array_merge( $common, $tablecell, $tablealign ),
15971575
1598 - # 12.2
 1576+ # 12.2 # NOTE: <a> is not allowed directly, but the attrib whitelist is used from the Parser object
15991577 'a' => array_merge( $common, array( 'href', 'rel', 'rev' ) ), # rel/rev esp. for RDFa
16001578
16011579 # 13.2
Index: trunk/phase3/includes/DefaultSettings.php
@@ -2238,13 +2238,11 @@
22392239
22402240 /**
22412241 * Enabled HTML5 microdata attributes for use in wikitext, if $wgHtml5 is also true.
2242 - * See also $wgAllowATag.
22432242 */
22442243 $wgAllowMicrodataAttributes = false;
22452244
22462245 /**
22472246 * Cleanup as much presentational html like valign -> css vertical-align as we can
2248 - * See also $wgAllowATag.
22492247 */
22502248 $wgCleanupPresentationalAttributes = true;
22512249
@@ -2977,14 +2975,6 @@
29782976 $wgAllowImageTag = false;
29792977
29802978 /**
2981 - * Allow <a> tags for specifying external links, so it becomes possible to
2982 - * provide ref and rel attributes. This allows for microdata/microformats/RDFa
2983 - * annotations to be embedded on wiki pages. See also $wgAllowRdfaAttributes
2984 - * and $wgAllowMicrodataAttributes.
2985 - */
2986 -$wgAllowATag = false;
2987 -
2988 -/**
29892979 * $wgUseTidy: use tidy to make sure HTML output is sane.
29902980 * Tidy is a free tool that fixes broken HTML.
29912981 * See http://www.w3.org/People/Raggett/tidy/

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109723Introducing optional support for <a> tags, to be used with microdata resp. RD...daniel05:58, 22 January 2012

Status & tagging log