-
- // Check to see if tried to access a directory
- if ( is_dir( $filename ) ) {
- wfForbidden( 'img-auth-accessdenied','img-auth-isdir', $filename );
- return;
- }
-
- // Extract the file name and chop off the size specifier.
- // (e.g. 120px-Foo.png => Foo.png or page2-120px-Foo.png => Foo.png).
- // This only applies to thumbnails, and all thumbnails should
- // be under a folder that has the source file name.
- $name = wfBaseName( $path );
- if ( strpos( $path, '/thumb/' ) === 0 ) {
- $name = wfBaseName( dirname( $path ) ); // this file is a thumbnail
- }