This change causes wiki syntax like
[[File:Foo.djvu|thumb|Page 7 of document]]
to be interpreted as a caption instead, of saying select page 7
of the djvu. Previously it eventually ran intval( '7 of document' ),
so flipped to page 7.
Only possible downside I could see is this would cause things like
left-to-right marks and weird unicode spaces to no longer be ignored.
I don't think that's a big deal.
Change-Id: Ie8c953009a38557876a274bf0f71ab470f66ef4e
* @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;