MagicWord: Fix an indent
[lhc/web/wiklou.git] / includes / media / DjVu.php
index aeba647..566efb2 100644 (file)
@@ -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;