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:
7c98afb
)
Don't create thumbnail images larger than the image; use the source image
author
Brion Vibber
<brion@users.mediawiki.org>
Thu, 29 Apr 2004 04:42:52 +0000
(
04:42
+0000)
committer
Brion Vibber
<brion@users.mediawiki.org>
Thu, 29 Apr 2004 04:42:52 +0000
(
04:42
+0000)
itself if asked. Reject attempts at zero or negative-width thumbs.
includes/Image.php
patch
|
blob
|
history
diff --git
a/includes/Image.php
b/includes/Image.php
index
27ad21e
..
ed69912
100644
(file)
--- a/
includes/Image.php
+++ b/
includes/Image.php
@@
-103,6
+103,17
@@
class Image
# If there is no image, there will be no thumbnail
return "";
}
+
+ # Sanity check $width
+ $width = IntVal( $width );
+ if( $width <= 0 ) {
+ # BZZZT
+ return "";
+ }
+ if( $width > $this->width ) {
+ # Don't make an image bigger than the source
+ return $this->getURL();
+ }
if ( (! file_exists( $thumbPath ) )
|| ( filemtime($thumbPath) < filemtime($this->imagePath) ) ) {