From: Andrei Zmievski Date: Wed, 31 May 2006 17:18:08 +0000 (+0000) Subject: MFB X-Git-Tag: php-5.2.0RC1~402 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f04ac91b003abd7aaeafb6f7a777b7669611812;p=php MFB --- diff --git a/main/main.c b/main/main.c index 174705ccde..b1d10c7a40 100644 --- a/main/main.c +++ b/main/main.c @@ -759,7 +759,12 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ MessageBox(NULL, buffer, error_type_str, MB_OK|ZEND_SERVICE_MB_STYLE); } #endif - spprintf(&log_buffer, 0, "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno); + if (SG(request_info).request_uri) { + char *query_string = SG(request_info).query_string; + spprintf(&log_buffer, 0, "PHP %s: %s in %s on line %d [%s%s%s]", error_type_str, buffer, error_filename, error_lineno, SG(request_info).request_uri, query_string?"?":"", STR_PRINT(query_string)); + } else { + spprintf(&log_buffer, 0, "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno); + } php_log_err(log_buffer TSRMLS_CC); efree(log_buffer); } @@ -781,13 +786,23 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ if (type == E_ERROR) { int len; char *buf = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC); - php_printf("%s
\n%s: %s in %s on line %d
\n%s", STR_PRINT(prepend_string), error_type_str, buf, error_filename, error_lineno, STR_PRINT(append_string)); + php_printf("%s
\n%s: %s in %s on line %d", STR_PRINT(prepend_string), error_type_str, buf, error_filename, error_lineno); efree(buf); } else { - php_printf("%s
\n%s: %s in %s on line %d
\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); + php_printf("%s
\n%s: %s in %s on line %d", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno); } + if (SG(request_info).request_uri) { + char *query_string = SG(request_info).query_string; + php_printf(" [%s%s%s]", SG(request_info).request_uri, query_string?"?":"", STR_PRINT(query_string)); + } + php_printf("
\n%s", STR_PRINT(append_string)); } else { - php_printf("%s\n%s: %s in %s on line %d\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); + php_printf("%s\n%s: %s in %s on line %d", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno); + if (SG(request_info).request_uri) { + char *query_string = SG(request_info).query_string; + php_printf(" [%s%s%s]", SG(request_info).request_uri, query_string?"?":"", STR_PRINT(query_string)); + } + php_printf("\n%s", STR_PRINT(append_string)); } } } diff --git a/main/php_compat.h b/main/php_compat.h index c01efad282..76df854c9b 100644 --- a/main/php_compat.h +++ b/main/php_compat.h @@ -29,6 +29,7 @@ #if defined(HAVE_BUNDLED_PCRE) || !defined(PHP_VERSION) #define pcre_compile php_pcre_compile +#define pcre_compile2 php_pcre_compile2 #define pcre_copy_substring php_pcre_copy_substring #define pcre_exec php_pcre_exec #define pcre_get_substring php_pcre_substring