Drag in a change noticed in wmf branches
authorSam Reed <reedy@users.mediawiki.org>
Sat, 11 Feb 2012 15:14:15 +0000 (15:14 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 11 Feb 2012 15:14:15 +0000 (15:14 +0000)
thumb.php

index 60a7ffb..eb0d67d 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -124,7 +124,7 @@ function wfStreamThumb( array $params ) {
 
        // Check permissions if there are read restrictions
        if ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) {
-               if ( !$img->getTitle()->userCan( 'read' ) ) {
+               if ( !$img->getTitle() || !$img->getTitle()->userCan( 'read' ) ) {
                        wfThumbError( 403, 'Access denied. You do not have permission to access ' .
                                'the source file.' );
                        wfProfileOut( __METHOD__ );