[svn r20557] FS#306 - Preparing for testing the social tool about encoding issues. First, rewriting the function api_is_xml_http_request() in a safe way. See http://www.electrictoolbox.com/how-to-tell-ajax-request-php/ .

skala
Ivan Tcholakov 17 years ago
parent f5ee591e58
commit f5a5bdb159
  1. 3
      main/inc/lib/main_api.lib.php

@ -3344,11 +3344,14 @@ if ( !function_exists('sys_get_temp_dir') )
* This function allow know when request sent is XMLHttpRequest
*/
function api_is_xml_http_request() {
/*
if ($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest') {
return true;
} else {
return false;
}
*/
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') ? true : false;
}
/**
* This function gets the hash in md5 or sha1 (it depends in the platform config) of a given password

Loading…
Cancel
Save