On 11/01/11 08:56, Beebe, Mary J wrote:
Within one of our older internal extensions, we have these 2 lines: $targetAsImage = Image::newFromTitle($onePage); $allPagesLinkedToTarget = $targetAsImage->getLinksTo();
We were trying to get a list of wiki titles that link to an image. This does not seem to work anymore with media wiki 1.15. Now that it is truly deprecated, what should we replace this with?
$targetAsImage = wfFindFile( $onePage ); if ( $targetAsImage ) { $allPagesLinkedToTarget = $targetAsImage->getLinksTo(); }
wfFindFile() will return false if the image does not exist, so you need to guard against that case to avoid a fatal error.