Forums

[resolved] [Plugin: WordPress Mobile Edition] Fix for Bug in WP Mobile 2.1 (1 post)

  1. megazone
    Member
    Posted 1 year ago #

    There is a bug in WP Mobile 2.1, in the function akm_mobile_exclude(). The variable $exclude is used twice - once as the flag to return, and once in the foreach as the item to check. This causes the return to NEVER be false, which is what you want it to be. Because it will return whatever the last value it had in the foreach. Replaced the function with this version, where I changed the foreach $exclude to $excludeitem and it is fine. I also reported this to Alex, the author, so hopefully he'll patch it in the next revision.

    function akm_mobile_exclude() {
            $exclude = false;
            $pages_to_exclude = array(
                    'wp-admin'
                    ,'wp-comments-post.php'
                    ,'wp-mail.php'
                    ,'wp-login.php'
            );
            foreach ($pages_to_exclude as $excludeitem) {
                    if (strstr(strtolower($_SERVER['REQUEST_URI']), $excludeitem)) \
    {
                            $exclude = true;
                    }
            }
            return $exclude;
    }

    http://wordpress.org/extend/plugins/wordpress-mobile-edition/

Topic Closed

This topic has been closed to new replies.

About this Topic