Page MenuHomePhabricator

SelectCategory: selecting no categories causes a PHP warning
Closed, ResolvedPublic

Description

Author: samuel.gelineau

Description:
When saving, the following PHP warning shows up unless at least one category is
selected in the select box.

Warning: Invalid argument supplied for foreach() in
/var/www/wiki/extensions/SelectCategory/SelectCategoryFunctions.php on line 92


Version: unspecified
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz9847

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:37 PM
bzimport set Reference to bz9847.
bzimport added a subscriber: Unknown Object (MLST).

samuel.gelineau wrote:

no_categories_bug.patch

Attached:

samuel.gelineau wrote:

Comment on attachment 3599
no_categories_bug.patch

checks for $_POST["SelectCategoryList"]'s presence

robchur wrote:

In general, we prefer to use the WebRequest object (global instance $wgRequest)
to handle incoming GET/POST data.

samuel.gelineau wrote:

As you can see in the patch`s contents, I merely followed the file`s existing style, which used $_POST.

WIKImaniac wrote:

The bug doesn't occur in revision 29737 any more.