]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Tools.class.php
a lot of enhancements related to tags: tags list is now sorted, shows number of artic...
[github/wallabag/wallabag.git] / inc / poche / Tools.class.php
old mode 100644 (file)
new mode 100755 (executable)
index eeb101b..ad451fc
@@ -311,4 +311,14 @@ class Tools
 
         return json_decode($json, true);
     }
+
+    /**
+     * Returns whether we handle an AJAX (XMLHttpRequest) request.
+     * @return boolean whether we handle an AJAX (XMLHttpRequest) request.
+     */
+    public static function isAjaxRequest()
+    {
+      return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH']==='XMLHttpRequest';
+    }
+
 }