/**
* Find a file.
* Shortcut for RepoGroup::singleton()->findFile()
+ * @param $title Either a string or Title object
* @param $options Associative array of options:
* time: requested time for an archived image, or false for the
* current version. An image object will be returned which was
/**
* Get an object referring to a locally registered file.
* Returns a valid placeholder object if the file does not exist.
+ * @param $title Either a string or Title object
+ * @return File, or null if passed an invalid Title
*/
function wfLocalFile( $title ) {
return RepoGroup::singleton()->getLocalRepo()->newFile( $title );
$name = $this->mCurrentRow->img_name;
$link = $this->getSkin()->linkKnown( Title::makeTitle( NS_FILE, $name ), $value );
$image = wfLocalFile( $value );
+ if( !$image ) {
+ wfDebug( __METHOD__ . " was passed a bogus title '$value'" );
+ return '';
+ }
$url = $image->getURL();
$download = Xml::element('a', array( 'href' => $url ), $imgfile );
return "$link ($download)";