function wfGrabDocThumb(&$parser, &$nt, &$ret) { if (!$nt) { return true; } //remove that annoying colon if it's there $nt = preg_replace('@:@', '', $nt); //do it $ret = DocViewer::GrabDocThumb($nt); return true; }
function wfGrabDocThumb(&$parser, &$nt, &$ret, $ns) { global $wgCanonicalNamespaceNames; if (!$nt) { return true; } if ($ns == NS_DOCUMENT) { //remove the namespace and colon $nt = preg_replace('@' . $wgCanonicalNamespaceNames[$ns] . ':@', '', $nt); //do it $ret = DocViewer::GrabDocThumb($nt); } return true; }