WordPress.org

Ready to get started?Download WordPress

Forums

Radio Station
PHP Warning in foreach (5 posts)

  1. Mike Auteri
    Member
    Posted 8 months ago #

    Not sure if anyone else is experiencing this, but when logging into WordPress, I get the following PHP warning:

    Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/raspy-robbin/wp-content/plugins/radio-station/radio-station.php on line 179

    I took a look at the foreach() and found that doing an is_array() check beforehand fixes the issue:

    //determine which roles should have full access aside from administrator
    $add_roles = array('administrator');
    if(is_array($wp_roles->roles)) {
    foreach($wp_roles->roles as $name => $role) {
    foreach($role['capabilities'] as $capname => $capstatus) {
    if($capname == "publish_shows" && ($capstatus == 1 || $capstatus == true)) {
    $add_roles[] = $name;
    }
    }
    }
    }

    If you can reproduce, you might want to add this check into the plugin with your next update. Thanks!

    http://wordpress.org/plugins/radio-station/

  2. Nikki Blight
    Member
    Plugin Author

    Posted 8 months ago #

    Thanks for the heads up. I'll get that added into the next version.

  3. Mike Auteri
    Member
    Posted 8 months ago #

    Awesome! Is the fix in 1.6.2 or going into 1.6.3? Thx.

  4. Nikki Blight
    Member
    Plugin Author

    Posted 8 months ago #

    It will be in 1.6.3.

  5. Mike Auteri
    Member
    Posted 8 months ago #

    Cool, thx. I'll patch 1.6.2 then.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.