Project

General

Profile

« Previous | Next » 

Revision 0e5ebefd

Added by NewEraCracker about 9 years ago

Fix PHP Warning about invalid argument supplied for foreach

If _POST['members'] or _POST['groups'] is not set / none selected at GUI, it would give a warning on crash reporter (dev versions)

(cherry picked from commit 9f4722022f0e8114741e8cf1a421520fded8be1f)

View differences:

src/usr/local/www/system_usermanager.php
237 237
	}
238 238

  
239 239
	/* Check the POSTed groups to ensure they are valid and exist */
240
	foreach ($_POST['groups'] as $newgroup) {
241
		if (empty(getGroupEntry($newgroup))) {
242
			$input_errors[] = gettext("One or more invalid groups was submitted.");
240
	if(is_array($_POST['groups'])) {
241
		foreach ($_POST['groups'] as $newgroup) {
242
			if (empty(getGroupEntry($newgroup))) {
243
				$input_errors[] = gettext("One or more invalid groups was submitted.");
244
			}
243 245
		}
244 246
	}
245 247

  

Also available in: Unified diff