X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=thumb.php;h=e38e62604d392fbe62f744c96000e3829e955d31;hp=43dd5d472fa34824054bc89a26535dd5ff133f2b;hb=6420c79320bc099cb4ff77232beabd72040146d0;hpb=75cffa0b998b300b4d79ab3d1e7f61857d32b1aa diff --git a/thumb.php b/thumb.php index 43dd5d472f..e38e62604d 100644 --- a/thumb.php +++ b/thumb.php @@ -155,7 +155,11 @@ function wfStreamThumb( array $params ) { // Check permissions if there are read restrictions $varyHeader = []; if ( !in_array( 'read', User::getGroupPermissions( [ '*' ] ), true ) ) { - if ( !$img->getTitle() || !$img->getTitle()->userCan( 'read' ) ) { + $user = RequestContext::getMain()->getUser(); + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + $imgTitle = $img->getTitle(); + + if ( !$imgTitle || !$permissionManager->userCan( 'read', $user, $imgTitle ) ) { wfThumbError( 403, 'Access denied. You do not have permission to access ' . 'the source file.' ); return;