[PATCH] Lots of undefined variable fixes
-
With WP_DEBUG turned on this module prints out alot of warnings. Fixes below.
Notice: Trying to get property of non-object in /path/to/wp-content/plugins/add-multiple-users/functions/settings.php on line 289-301
In the above file change the given lines from
if($setting->
to
if(is_object($setting) && $setting->
Strict standards: Only variables should be passed by reference in /path/to/wp-content/plugins/add-multiple-users/functions/csvimport.php on line 152
Change
$allowedExtensions = array("txt","TXT","csv","CSV"); if (!in_array(end(explode(".", strtolower($_FILES['csvuploader']['name']))), $allowedExtensions)) {
to
$fileExtension = explode(".", strtolower($_FILES['csvuploader']['name'])); $fileExtension = end($fileExtension); if (!in_array($fileExtension, $allowedExtensions)) {
Notice: Undefined variable: classes in /path/to/wp-content/plugins/add-multiple-users/functions/commonfn.php on line 127,131
Change
$classes == '';
to
$classes = '';
Notice: Undefined property: amuUserObject::$user_url in /path/to/wp-content/plugins/add-multiple-users/functions/commonfn.php on line 363
Change
if($this->user_url && $this->user_url !== '') {
to
if($this->user_url && !empty($this->user_url) && $this->user_url !== '') {
Notice: Undefined property: amuUserObject::$user_registered in /path/to/wp-content/plugins/add-multiple-users/functions/commonfn.php on line 366
Change
if($this->user_registered && $this->user_registered !== '') {
to
if($this->user_registered && !empty($this->user_registered) && $this->user_registered !== '') {
Notice: Undefined property: amuUserObject::$user_nicename in /path/to/wp-content/plugins/add-multiple-users/functions/commonfn.php on line 369
Change
if($this->user_nicename && $this->user_nicename !== '') {
to
if($this->user_nicename && !empty($this->user_nicename) && $this->user_nicename !== '') {
Notice: Undefined property: amuUserObject::$display_name in /path/to/wp-content/plugins/add-multiple-users/functions/commonfn.php on line 372
Change
if($this->display_name && $this->display_name !== '') {
to
if($this->display_name && !empty($this->display_name) && $this->display_name !== '') {
- The topic ‘[PATCH] Lots of undefined variable fixes’ is closed to new replies.