1.20.x bootstrap.inc backdrop_is_ajax()

Detects if this is an AJAX HTTP request.

File

includes/bootstrap.inc, line 4535
Functions that need to be loaded on every Backdrop request.

Code

function backdrop_is_ajax() {
  return !empty($_POST) && !empty($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.backdrop-ajax') === 0;
}