r111441 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111440‎ | r111441 | r111442 >
Date:02:24, 14 February 2012
Author:dantman
Status:deferred
Tags:
Comment:
Make use of the property: support added in 1.20 if available.
Modified paths:
  • /trunk/extensions/OpenGraphMeta/OpenGraphMeta.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenGraphMeta/OpenGraphMeta.php
@@ -104,9 +104,13 @@
105105 }
106106
107107 foreach( $meta as $property => $value ) {
108 - if ( $value )
109 - //$out->addMeta($property, $value ); // FB wants property= instead of name= blech, is that even valid html?
110 - $out->addHeadItem("meta:property:$property", " ".Html::element( 'meta', array( 'property' => $property, 'content' => $value ) )."\n");
 108+ if ( $value ) {
 109+ if ( isset( OutputPage::$metaAttrPrefixes ) && isset( OutputPage::$metaAttrPrefixes['property'] ) ) {
 110+ $out->addMeta( "property:$property", $value );
 111+ } else {
 112+ $out->addHeadItem("meta:property:$property", " ".Html::element( 'meta', array( 'property' => $property, 'content' => $value ) )."\n");
 113+ }
 114+ }
111115 }
112116
113117 return true;

Status & tagging log