r92117 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92116‎ | r92117 | r92118 >
Date:22:50, 13 July 2011
Author:sean_colombo
Status:deferred
Tags:
Comment:
OpenGraphMeta: since wfFindFile() is used to fill the mMainImage, it could return false in cases where the image does exist or no longer exists... now protecting against that.
Modified paths:
  • /trunk/extensions/OpenGraphMeta/OpenGraphMeta.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenGraphMeta/OpenGraphMeta.php
@@ -78,7 +78,7 @@
7979 $meta["og:title"] = $title->getText();
8080 }
8181
82 - if ( isset($out->mMainImage) ) {
 82+ if ( isset($out->mMainImage) && ($out->mMainImage !== false) ) {
8383 $meta["og:image"] = wfExpandUrl($out->mMainImage->createThumb(100*3, 100));
8484 } else if ( $isMainpage ) {
8585 $meta["og:image"] = $wgLogo;

Status & tagging log