array( &$this, $categories, &$this->mCategoryLinks ) )
) {
foreach ( $categories as $category => $type ) {
+ // array keys will cast numeric category names to ints, so cast back to string
+ $category = (string)$category;
$origcategory = $category;
$title = Title::makeTitleSafe( NS_CATEGORY, $category );
if ( !$title ) {
*/
public function userCanPreview() {
$request = $this->getRequest();
- if ( $request->getVal( 'action' ) !== 'submit' || !$request->wasPosted() ) {
+ if (
+ $request->getVal( 'action' ) !== 'submit' ||
+ !$request->getCheck( 'wpPreview' ) ||
+ !$request->wasPosted()
+ ) {
return false;
}