Closed elcreator closed 9 years ago
maybe you mean global $candidates; (repeating globals in many functions is not good, maybe we need in candidates.php
function candidates() {
global $candidates_test, $candidates;
/**
* candidates switch
*/
return $candidates_test;
}
instead).
Or simply require_once("candidates.php");
also is_array($candidates) is good in suggested function candidates or before foreach. Because if you not sure even that $candidates exists, you also not sure that foreach not fails with uncatchable exception
a method of storing candidates will be changed soon.
https://github.com/imaginal/nabuvote/blob/master/system/functions.php#L558 https://github.com/imaginal/nabuvote/blob/master/system/functions.php#L575 https://github.com/imaginal/nabuvote/blob/master/system/functions.php#L591 $candidates is undefined here and can't be not empty