jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/334500 )

Change subject: NSFileRepo: deliver images without a file repository e.g. Math 
extension
......................................................................


NSFileRepo: deliver images without a file repository e.g. Math extension

Fixed issue from ERM5234

Needs merge to master

Change-Id: Ia6e0ed77cb9c0db6ab0e79252e2d1c190c045293
---
M nsfr_img_auth.php
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Robert Vogel: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/nsfr_img_auth.php b/nsfr_img_auth.php
index 3ee839e..de9725c 100644
--- a/nsfr_img_auth.php
+++ b/nsfr_img_auth.php
@@ -154,8 +154,12 @@
                if ( !$file->exists() || $file->isDeleted( File::DELETED_FILE ) 
) {
                        $file = wfFindFile( $name ); //Give other repos a 
chance to handle this
                        if( !$file || !$file->exists() || $file->isDeleted( 
File::DELETED_FILE ) ) {
-                               wfForbidden( 'img-auth-accessdenied', 
'img-auth-nofile', $filename );
-                               return;
+
+                               global $wgUploadDirectory;
+                               if( !file_exists( $wgUploadDirectory.$path ) ) {
+                                       wfForbidden( 'img-auth-accessdenied', 
'img-auth-nofile', $filename );
+                                       return;
+                               }
                        }
                }
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/334500
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6e0ed77cb9c0db6ab0e79252e2d1c190c045293
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NSFileRepo
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <vo...@hallowelt.biz>
Gerrit-Reviewer: Nasty <kon...@hallowelt.com>
Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to