AllPages API fix for old MediaWiki versions

Nemo ran into this issue recently. Fixed.