r111975 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111974‎ | r111975 | r111976 >
Date:22:48, 20 February 2012
Author:dantman
Status:ok
Tags:
Comment:
Revert RDFa and Microdata improvements to addMeta in r111439 till after the git migration.
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -232,15 +232,6 @@
233233 private $mRedirectedFrom = null;
234234
235235 /**
236 - * Name prefixes that can be used in addMeta
237 - */
238 - public static $metaAttrPrefixes = array(
239 - 'http' => 'http-equiv',
240 - 'itemprop' => 'itemprop',
241 - 'property' => 'property',
242 - );
243 -
244 - /**
245236 * Constructor for OutputPage. This should not be called directly.
246237 * Instead a new RequestContext should be created and it will implicitly create
247238 * a OutputPage tied to that context.
@@ -287,13 +278,7 @@
288279 /**
289280 * Add a new <meta> tag
290281 * To add an http-equiv meta tag, precede the name with "http:"
291 - * To add a Microdata itemprop meta tag, precede the name with "itemprop:"
292 - * To add a RDFa property meta tag, precede the name with "property:"
293282 *
294 - * itemprop: and property: were introduced in 1.20, you can feature
295 - * test for them by checking for the key in the new
296 - * OutputPage::$metaAttrPrefixes variable.
297 - *
298283 * @param $name String tag name
299284 * @param $val String tag value
300285 */
@@ -3010,16 +2995,11 @@
30112996 }
30122997
30132998 foreach ( $this->mMetatags as $tag ) {
3014 - $a = 'name'; // default attribute
3015 - foreach ( self::$metaAttrPrefixes as $prefix => $attribute ) {
3016 - // Check if the name starts with the prefix
3017 - if ( strpos( $tag[0], "$prefix:" ) === 0 ) {
3018 - // Set the attribute name we're using
3019 - $a = $attribute;
3020 - // Strip the prefix from the name
3021 - $tag[0] = substr( $tag[0], strlen( $prefix ) + 1 );
3022 - break;
3023 - }
 2999+ if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
 3000+ $a = 'http-equiv';
 3001+ $tag[0] = substr( $tag[0], 5 );
 3002+ } else {
 3003+ $a = 'name';
30243004 }
30253005 $tags[] = Html::element( 'meta',
30263006 array(

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111439Introduce property: and itemprop: support for addMeta to add RDFa <meta prope...dantman02:22, 14 February 2012

Status & tagging log