Support » Plugin: WPtouch Mobile Plugin » wrong is_ajax check in single/page/index.php

  • 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 ( 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(); ?>

  • The topic ‘wrong is_ajax check in single/page/index.php’ is closed to new replies.