- 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 ) );