X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=img_auth.php;h=55f17ac7f474e11dc5d6727179af5eafebc964e7;hb=b6fc9067b0405603d250759cb73c41b8c8627d31;hp=a3485dfd7e3a443dbfbdb4dffe0c757a26607576;hpb=8927e731ac300bf49de47d6d23b5568e29f76739;p=lhc%2Fweb%2Fwiklou.git diff --git a/img_auth.php b/img_auth.php index a3485dfd7e..55f17ac7f4 100644 --- a/img_auth.php +++ b/img_auth.php @@ -106,14 +106,15 @@ function wfImageAuthMain() { // Get the local file repository $repo = RepoGroup::singleton()->getRepo( 'local' ); + $zone = strstr( ltrim( $path, '/' ), '/', true ); // Get the full file storage path and extract the source file name. // (e.g. 120px-Foo.png => Foo.png or page2-120px-Foo.png => Foo.png). - // This only applies to thumbnails, and all thumbnails should + // This only applies to thumbnails/transcoded, and each of them should // be under a folder that has the source file name. - if ( strpos( $path, '/thumb/' ) === 0 ) { - $name = wfBaseName( dirname( $path ) ); // file is a thumbnail - $filename = $repo->getZonePath( 'thumb' ) . substr( $path, 6 ); // strip "/thumb" + if ( $zone === 'thumb' || $zone === 'transcoded' ) { + $name = wfBaseName( dirname( $path ) ); + $filename = $repo->getZonePath( $zone ) . substr( $path, strlen( "/" . $zone ) ); // Check to see if the file exists if ( !$repo->fileExists( $filename ) ) { wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $filename );