Index: trunk/phase3/img_auth.php |
— | — | @@ -94,12 +94,12 @@ |
95 | 95 | return; |
96 | 96 | } |
97 | 97 | |
98 | | - // Extract the file name and chop off the size specifier. |
| 98 | + // Extract the file name and chop off the size specifier |
99 | 99 | // (e.g. 120px-Foo.png => Foo.png or page2-120px-Foo.png => Foo.png). |
100 | | - // This only applies to thumbnails, and all thumbnails should |
101 | | - // be under a folder that has the source file name. |
| 100 | + // This only applies to thumbnails, and all thumbnails should have |
| 101 | + // a width indicator and be under a folder that has the source file name. |
102 | 102 | $name = wfBaseName( $path ); |
103 | | - if ( strpos( $path, '/thumb/' ) === 0 ) { |
| 103 | + if ( preg_match( '!(?:[^-]*-)*?\d+px-(.*)!i', $name ) ) { |
104 | 104 | $name = wfBaseName( dirname( $path ) ); // this file is a thumbnail |
105 | 105 | } |
106 | 106 | |