WordPress.org

Ready to get started?Download WordPress

Forums

WPtouch Mobile Plugin
wrong is_ajax check in single/page/index.php (1 post)

  1. veke
    Member
    Posted 1 year ago #

    Hello there,

    after some headaches i found out you're checking if the request was ajax by using the following line of code:

    <?php global $is_ajax; $is_ajax = isset($_SERVER['HTTP_X_REQUESTED_WITH']); if (!$is_ajax) get_header(); ?>

    By using android stock browser which sends the HTTP_X_REQUESTED_WITH with content com.google.android.browser. ( Ref: this page ) the page will be incomplete ( no header + no footer )

    In order to fix the issue you will need to refactor the above mentioned line of code with the following:

    <?php global $is_ajax; $is_ajax = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'xmlhttprequest'; if (!$is_ajax) get_header(); ?>
    Cheers,

    http://wordpress.org/extend/plugins/wptouch/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.