dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b9e1326
)
FU r104216: keep the r103738 regex check for thumbnails but use the parent directory...
author
Aaron Schulz
<aaron@users.mediawiki.org>
Mon, 5 Dec 2011 19:17:44 +0000
(19:17 +0000)
committer
Aaron Schulz
<aaron@users.mediawiki.org>
Mon, 5 Dec 2011 19:17:44 +0000
(19:17 +0000)
img_auth.php
patch
|
blob
|
history
diff --git
a/img_auth.php
b/img_auth.php
index
8b12181
..
fc431f8
100644
(file)
--- a/
img_auth.php
+++ b/
img_auth.php
@@
-94,12
+94,12
@@
function wfImageAuthMain() {
return;
}
return;
}
- // Extract the file name and chop off the size specifier
.
+ // Extract the file name and chop off the size specifier
// (e.g. 120px-Foo.png => Foo.png or page2-120px-Foo.png => Foo.png).
// (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.
+ // This only applies to thumbnails, and all thumbnails should
have
+ //
a width indicator and
be under a folder that has the source file name.
$name = wfBaseName( $path );
$name = wfBaseName( $path );
- if (
strpos( $path, '/thumb/' ) === 0
) {
+ if (
preg_match( '!(?:[^-]*-)*?\d+px-(.*)!i', $name )
) {
$name = wfBaseName( dirname( $path ) ); // this file is a thumbnail
}
$name = wfBaseName( dirname( $path ) ); // this file is a thumbnail
}