X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FDjVu.php;h=566efb2b6e36dbd068ae5c1853c86d4ad6bacb25;hb=a5d145ae3ccb14f0f5e99a769eadfeb70755a972;hp=2aeb35dfe35133ecf4cb995bc9c3b6c68e73c7f4;hpb=c45d497eda452d619b61b0da231c1c753d8cac93;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index 2aeb35dfe3..566efb2b6e 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -73,6 +73,11 @@ class DjVuHandler extends ImageHandler { * @return bool */ function validateParam( $name, $value ) { + if ( $name === 'page' && trim( $value ) !== (string) intval( $value ) ) { + // Extra junk on the end of page, probably actually a caption + // e.g. [[File:Foo.djvu|thumb|Page 3 of the document shows foo]] + return false; + } if ( in_array( $name, array( 'width', 'height', 'page' ) ) ) { if ( $value <= 0 ) { return false; @@ -260,7 +265,7 @@ class DjVuHandler extends ImageHandler { * Get metadata, unserializing it if neccessary. * * @param File $file The DjVu file in question - * @return String XML metadata as a string. + * @return string XML metadata as a string. */ private function getUnserializedMetadata( File $file ) { $metadata = $file->getMetadata();