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

  1. veke
    Posted 2 years 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(); ?>


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WPtouch Mobile Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.