From 0eea910f4bcaffeb4c6193f4a06f1d187d3a197d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 8 Jan 2013 17:27:52 +0000 Subject: [PATCH] Added more logging of half-failed AJAX requests --- ajax.php | 2 +- inc/ajax-functions.php | 3 +++ inc/ajax/ajax_admin.php | 1 + inc/ajax/ajax_installer.php | 1 + robots.txt | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ajax.php b/ajax.php index be378a274a..e267e9f9b9 100644 --- a/ajax.php +++ b/ajax.php @@ -75,7 +75,7 @@ if ((getHttpRequestMethod() == 'POST') && (isPostRequestElementSet('level'))) { // Is there an error which is not fine? if (!isAjaxHttpStatusAccepted()) { // The process was handled but didn't work - reportBug(__FUNCTION__, __LINE__, 'AJAX request is valid but does not do anything.'); + reportBug(__FUNCTION__, __LINE__, 'AJAX request level=' . isPostRequestElementSet('level') . ',status=' . getHttpStatus() . ',callback[' . gettype($GLOBALS['ajax_callback_function']) . ']=' . $GLOBALS['ajax_callback_function'] . ' is valid but does not do anything.'); } // END - if } else { // Not allowed diff --git a/inc/ajax-functions.php b/inc/ajax-functions.php index 59ad97d181..43a6244afa 100644 --- a/inc/ajax-functions.php +++ b/inc/ajax-functions.php @@ -48,6 +48,9 @@ function initAjax () { 'reply_content' => NULL, ); + // Init call-back debug information + $GLOBALS['ajax_callback_function'] = NULL; + // Set content type (mostly JSON) setContentType('application/json'); diff --git a/inc/ajax/ajax_admin.php b/inc/ajax/ajax_admin.php index e93830cba6..a7fe37dc1c 100644 --- a/inc/ajax/ajax_admin.php +++ b/inc/ajax/ajax_admin.php @@ -60,6 +60,7 @@ function doAjaxProcessAdmin () { // Again we do a call-back, so generate a function name depending on 'do' $callbackName = 'doAjaxAdmin' . capitalizeUnderscoreString(postRequestElement('do')); + $GLOBALS['ajax_callback_function'] = $callbackName; // Is the call-back function there? if (!function_exists($callbackName)) { diff --git a/inc/ajax/ajax_installer.php b/inc/ajax/ajax_installer.php index f1e7eb7aaa..ada36bf66c 100644 --- a/inc/ajax/ajax_installer.php +++ b/inc/ajax/ajax_installer.php @@ -103,6 +103,7 @@ function doAjaxProcessInstall () { // Again we do a call-back, so generate a function name depending on 'do' $callbackName = 'doAjaxInstaller' . capitalizeUnderscoreString(postRequestElement('do')); + $GLOBALS['ajax_callback_function'] = $callbackName; // Is the call-back function there? if (!function_exists($callbackName)) { diff --git a/robots.txt b/robots.txt index deb9983893..5b0391be8a 100644 --- a/robots.txt +++ b/robots.txt @@ -430,7 +430,7 @@ Disallow: / User-agent: searchpreview Disallow: / -# This is for my webpages +# This is for my web pages using spider-trap User-agent: * Disallow: /guestbook/ Disallow: /blacklist.txt -- 2.39.5