summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2002-07-08 12:52:22 +0000
committerDerick Rethans <derick@php.net>2002-07-08 12:52:22 +0000
commit728f2de4420f75bd3ac1813d2c227fc7f4a0a81d (patch)
tree4f9c64153fff9698be0bdbc3eb45fc9714037db7 /ext/standard
parentbd356fd0b99eb05d19b1dd4a616df90097baca88 (diff)
downloadphp-git-728f2de4420f75bd3ac1813d2c227fc7f4a0a81d.tar.gz
Unify error messages
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/aggregation.c4
-rw-r--r--ext/standard/assert.c6
-rw-r--r--ext/standard/basic_functions.c60
-rw-r--r--ext/standard/browscap.c2
-rw-r--r--ext/standard/cyr_convert.c4
-rw-r--r--ext/standard/datetime.c12
-rw-r--r--ext/standard/dir.c10
-rw-r--r--ext/standard/dl.c18
-rw-r--r--ext/standard/dns.c6
-rw-r--r--ext/standard/exec.c24
-rw-r--r--ext/standard/file.c32
-rw-r--r--ext/standard/filestat.c26
-rw-r--r--ext/standard/formatted_print.c6
-rw-r--r--ext/standard/ftok.c4
-rw-r--r--ext/standard/head.c2
-rw-r--r--ext/standard/html.c3
-rw-r--r--ext/standard/image.c6
-rw-r--r--ext/standard/iptc.c6
-rw-r--r--ext/standard/levenshtein.c2
19 files changed, 116 insertions, 117 deletions
diff --git a/ext/standard/aggregation.c b/ext/standard/aggregation.c
index cea8c8138d..556ed8f25b 100644
--- a/ext/standard/aggregation.c
+++ b/ext/standard/aggregation.c
@@ -339,7 +339,7 @@ static void aggregate(INTERNAL_FUNCTION_PARAMETERS, int aggr_what, int aggr_type
zend_str_tolower(class_name_lc, class_name_len);
if (zend_hash_find(EG(class_table), class_name_lc,
class_name_len+1, (void **)&ce) == FAILURE) {
- php_error(E_WARNING, "%s() expects parameter 2 to be a valid class name, '%s' given\n", get_active_function_name(TSRMLS_C), class_name);
+ php_error(E_WARNING, "%s(): Expects the second parameter to be a valid class name, '%s' given", get_active_function_name(TSRMLS_C), class_name);
efree(class_name_lc);
return;
}
@@ -614,7 +614,7 @@ PHP_FUNCTION(deaggregate)
if (zend_hash_find(EG(class_table), Z_OBJCE_P(obj)->name,
Z_OBJCE_P(obj)->name_length+1, (void **)&orig_ce) == FAILURE) {
- php_error(E_WARNING, "internal deaggregation error");
+ php_error(E_WARNING, "%s(): Internal deaggregation error", get_active_function_name (TSRMLS_C));
return;
}
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index be6db3731c..ca85730041 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -206,9 +206,9 @@ PHP_FUNCTION(assert)
if (ASSERTG(warning)) {
if (myeval) {
- php_error(E_WARNING, "Assertion \"%s\" failed", myeval);
+ php_error(E_WARNING, "%s(): Assertion \"%s\" failed", get_active_function_name (TSRMLS_C), myeval);
} else {
- php_error(E_WARNING, "Assertion failed");
+ php_error(E_WARNING, "%s(): Assertion failed", get_active_function_name (TSRMLS_C));
}
}
@@ -282,7 +282,7 @@ PHP_FUNCTION(assert_options)
break;
default:
- php_error(E_WARNING, "Unknown value %d.", Z_LVAL_PP(what));
+ php_error(E_WARNING, "%s(): Unknown value %d", get_active_function_name (TSRMLS_C), Z_LVAL_PP(what));
break;
}
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 54d87b5ebe..4634a71e1e 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1150,7 +1150,7 @@ PHP_FUNCTION(constant)
convert_to_string_ex(const_name);
if (!zend_get_constant(Z_STRVAL_PP(const_name), Z_STRLEN_PP(const_name), return_value TSRMLS_CC)) {
- php_error(E_WARNING, "Couldn't find constant %s", Z_STRVAL_PP(const_name));
+ php_error(E_WARNING, "%s(): Couldn't find constant %s", get_active_function_name (TSRMLS_C), Z_STRVAL_PP(const_name));
RETURN_NULL();
}
}
@@ -1244,7 +1244,7 @@ PHP_FUNCTION(putenv)
if (PG(safe_mode)) {
/* Check the protected list */
if (zend_hash_exists(&BG(sm_protected_env_vars), pe.key, pe.key_len)) {
- php_error(E_WARNING, "Safe Mode: Cannot override protected environment variable '%s'", pe.key);
+ php_error(E_WARNING, "%s(): Safe Mode warning: Cannot override protected environment variable '%s'", get_active_function_name (TSRMLS_C), pe.key);
efree(pe.putenv_string);
efree(pe.key);
RETURN_FALSE;
@@ -1265,7 +1265,7 @@ PHP_FUNCTION(putenv)
}
efree(allowed_env_vars);
if (!allowed) {
- php_error(E_WARNING, "Safe Mode: Cannot set environment variable '%s' - it's not in the allowed list", pe.key);
+ php_error(E_WARNING, "%s(): Safe Mode warning: Cannot set environment variable '%s' - it's not in the allowed list", get_active_function_name (TSRMLS_C), pe.key);
efree(pe.putenv_string);
efree(pe.key);
RETURN_FALSE;
@@ -1430,14 +1430,14 @@ PHP_FUNCTION(error_log)
switch (ZEND_NUM_ARGS()) {
case 1:
if (zend_get_parameters_ex(1, &string) == FAILURE) {
- php_error(E_WARNING, "Invalid argument 1 in error_log");
+ php_error(E_WARNING, "%s(): Argument 1 invalid", get_active_function_name (TSRMLS_C));
RETURN_FALSE;
}
break;
case 2:
if (zend_get_parameters_ex(2, &string, &erropt) == FAILURE) {
- php_error(E_WARNING, "Invalid arguments in error_log");
+ php_error(E_WARNING, "%s(): Invalid arguments", get_active_function_name (TSRMLS_C));
RETURN_FALSE;
}
convert_to_long_ex(erropt);
@@ -1445,9 +1445,8 @@ PHP_FUNCTION(error_log)
break;
case 3:
- if (zend_get_parameters_ex(3, &string, &erropt, &option) ==
- FAILURE) {
- php_error(E_WARNING, "Invalid arguments in error_log");
+ if (zend_get_parameters_ex(3, &string, &erropt, &option) == FAILURE) {
+ php_error(E_WARNING, "%s(): Invalid arguments", get_active_function_name (TSRMLS_C));
RETURN_FALSE;
}
convert_to_long_ex(erropt);
@@ -1457,9 +1456,8 @@ PHP_FUNCTION(error_log)
break;
case 4:
- if (zend_get_parameters_ex
- (4, &string, &erropt, &option, &emailhead) == FAILURE) {
- php_error(E_WARNING, "Invalid arguments in error_log");
+ if (zend_get_parameters_ex (4, &string, &erropt, &option, &emailhead) == FAILURE) {
+ php_error(E_WARNING, "%s(): Invalid arguments in", get_active_function_name (TSRMLS_C));
RETURN_FALSE;
}
break;
@@ -1508,14 +1506,14 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T
return FAILURE;
}
#else
- php_error(E_WARNING, "Mail option not available!");
+ php_error(E_WARNING, "%s(): Mail option not available!", get_active_function_name (TSRMLS_C));
return FAILURE;
#endif
}
break;
case 2: /*send to an address */
- php_error(E_WARNING, "TCP/IP option not available!");
+ php_error(E_WARNING, "%s(): TCP/IP option not available!", get_active_function_name (TSRMLS_C));
return FAILURE;
break;
@@ -1560,7 +1558,7 @@ PHP_FUNCTION(call_user_func)
}
if (!zend_is_callable(*params[0], 0, &name)) {
- php_error(E_WARNING, "%s() expects first argument, '%s', to be a valid callback", get_active_function_name(TSRMLS_C), name);
+ php_error(E_WARNING, "%s(): First argumented is expected to be a valid callback, '%s' was given", get_active_function_name(TSRMLS_C), name);
efree(name);
efree(params);
RETURN_NULL();
@@ -1569,7 +1567,7 @@ PHP_FUNCTION(call_user_func)
if (call_user_function_ex(EG(function_table), NULL, *params[0], &retval_ptr, argc-1, params+1, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {
- php_error(E_WARNING, "Unable to call %s()", name);
+ php_error(E_WARNING, "%s(): Unable to call %s()", get_active_function_name (TSRMLS_C), name);
}
efree(name);
@@ -1601,7 +1599,7 @@ PHP_FUNCTION(call_user_func_array)
}
if (!zend_is_callable(*func, 0, &name)) {
- php_error(E_WARNING, "%s() expects first argument, '%s', to be a valid callback", get_active_function_name(TSRMLS_C), name);
+ php_error(E_WARNING, "%s(): First argumented is expected to be a valid callback, '%s' was given", get_active_function_name(TSRMLS_C), name);
efree(name);
RETURN_NULL();
}
@@ -1621,7 +1619,7 @@ PHP_FUNCTION(call_user_func_array)
if (call_user_function_ex(EG(function_table), NULL, *func, &retval_ptr, count, func_params, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {
- php_error(E_WARNING, "Unable to call %s()", name);
+ php_error(E_WARNING, "%s(): Unable to call %s()", get_active_function_name(TSRMLS_C), name);
}
efree(name);
@@ -1629,7 +1627,7 @@ PHP_FUNCTION(call_user_func_array)
}
/* }}} */
-#define _CUM_DEPREC "The %s() function is deprecated, use the call_user_func variety with the array(&$obj, \"method\") syntax instead"
+#define _CUM_DEPREC "%s(): This function is deprecated, use the call_user_func variety with the array(&$obj, \"method\") syntax instead"
/* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
Call a user method on a specific object or class */
@@ -1639,7 +1637,7 @@ PHP_FUNCTION(call_user_method)
zval *retval_ptr;
int arg_count = ZEND_NUM_ARGS();
- php_error(E_NOTICE, _CUM_DEPREC, "call_user_method");
+ php_error(E_NOTICE, _CUM_DEPREC, get_active_function_name(TSRMLS_C));
if (arg_count < 2) {
WRONG_PARAM_COUNT;
@@ -1651,7 +1649,7 @@ PHP_FUNCTION(call_user_method)
RETURN_FALSE;
}
if (Z_TYPE_PP(params[1]) != IS_OBJECT && Z_TYPE_PP(params[1]) != IS_STRING) {
- php_error(E_WARNING, "2nd argument is not an object or class name\n");
+ php_error(E_WARNING, "%s(): Second argument is not an object or class name", get_active_function_name(TSRMLS_C));
efree(params);
RETURN_FALSE;
}
@@ -1662,7 +1660,7 @@ PHP_FUNCTION(call_user_method)
if (call_user_function_ex(EG(function_table), params[1], *params[0], &retval_ptr, arg_count-2, params+2, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {
- php_error(E_WARNING, "Unable to call %s()", Z_STRVAL_PP(params[0]));
+ php_error(E_WARNING, "%s(): Unable to call %s()", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(params[0]));
}
efree(params);
}
@@ -1676,14 +1674,14 @@ PHP_FUNCTION(call_user_method_array)
HashTable *params_ar;
int num_elems, element = 0;
- php_error(E_NOTICE, _CUM_DEPREC, "call_user_method_array");
+ php_error(E_NOTICE, _CUM_DEPREC, get_active_function_name(TSRMLS_C));
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &method_name, &obj, &params) == FAILURE) {
WRONG_PARAM_COUNT;
}
if (Z_TYPE_PP(obj) != IS_OBJECT && Z_TYPE_PP(obj) != IS_STRING) {
- php_error(E_WARNING, "2nd argument is not an object or class name\n");
+ php_error(E_WARNING, "%s(): Second argument is not an object or class name", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -1706,7 +1704,7 @@ PHP_FUNCTION(call_user_method_array)
if (call_user_function_ex(EG(function_table), obj, *method_name, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {
- php_error(E_WARNING, "Unable to call %s()", Z_STRVAL_PP(method_name));
+ php_error(E_WARNING, "%s(): Unable to call %s()", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(method_name));
}
efree(method_args);
@@ -1747,7 +1745,7 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun
zval_dtor(&retval);
} else {
- php_error(E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(shutdown_function_entry->arguments[0]));
+ php_error(E_WARNING, "%s(): Unable to call %s() - function does not exist", get_active_function_name(TSRMLS_C), Z_STRVAL_P(shutdown_function_entry->arguments[0]));
}
return 0;
}
@@ -1769,15 +1767,15 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC)
zval **obj, **method;
if (Z_TYPE_P(function) == IS_STRING) {
- php_error(E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
+ php_error(E_WARNING, "%s(): Unable to call %s() - function does not exist", get_active_function_name(TSRMLS_C), Z_STRVAL_P(function));
} else if ( Z_TYPE_P(function) == IS_ARRAY
&& zend_hash_index_find(Z_ARRVAL_P(function), 0, (void **) &obj) == SUCCESS
&& zend_hash_index_find(Z_ARRVAL_P(function), 1, (void **) &method) == SUCCESS
&& Z_TYPE_PP(obj) == IS_OBJECT
&& Z_TYPE_PP(method) == IS_STRING ) {
- php_error(E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_PP(obj)->name, Z_STRVAL_PP(method));
+ php_error(E_WARNING, "%s(): Unable to call %s::%s() - function does not exist", get_active_function_name(TSRMLS_C), Z_OBJCE_PP(obj)->name, Z_STRVAL_PP(method));
} else {
- php_error(E_WARNING, "Unable to call tick function");
+ php_error(E_WARNING, "%s(): Unable to call tick function", get_active_function_name(TSRMLS_C));
}
}
}
@@ -2013,7 +2011,7 @@ PHP_FUNCTION(ini_get_all)
if(extname) {
if (zend_hash_find(&module_registry, extname, extname_len+1, (void **) &module) == FAILURE) {
- php_error(E_WARNING, "Unable to find extension '%s'", extname);
+ php_error(E_WARNING, "%s(): Unable to find extension '%s'", get_active_function_name(TSRMLS_C), extname);
RETURN_FALSE;
}
extnumber = module->module_number;
@@ -2364,7 +2362,7 @@ PHP_FUNCTION(move_uploaded_file)
if (successful) {
zend_hash_del(SG(rfc1867_uploaded_files), Z_STRVAL_PP(path), Z_STRLEN_PP(path)+1);
} else {
- php_error(E_WARNING, "Unable to move '%s' to '%s'", Z_STRVAL_PP(path), Z_STRVAL_PP(new_path));
+ php_error(E_WARNING, "%s(): Unable to move '%s' to '%s'", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(path), Z_STRVAL_PP(new_path));
}
RETURN_BOOL(successful);
}
@@ -2489,7 +2487,7 @@ PHP_FUNCTION(parse_ini_file)
fh.handle.fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "r");
if (!fh.handle.fp) {
- php_error(E_WARNING, "Cannot open '%s' for reading", Z_STRVAL_PP(filename));
+ php_error(E_WARNING, "%s(): Cannot open '%s' for reading", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(filename));
return;
}
Z_TYPE(fh) = ZEND_HANDLE_FP;
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 8c696c5fad..f1e9ca40c2 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -149,7 +149,7 @@ PHP_MINIT_FUNCTION(browscap)
fh.handle.fp = VCWD_FOPEN(browscap, "r");
if (!fh.handle.fp) {
- php_error(E_CORE_WARNING, "Cannot open '%s' for reading", browscap);
+ php_error(E_CORE_WARNING, "%s(): Cannot open '%s' for reading", get_active_function_name(TSRMLS_C), browscap);
return FAILURE;
}
fh.filename = browscap;
diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c
index 9eab83e546..7437104f48 100644
--- a/ext/standard/cyr_convert.c
+++ b/ext/standard/cyr_convert.c
@@ -228,7 +228,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from,
case 'K':
break;
default:
- php_error(E_WARNING, "Unknown source charset: %c", from);
+ php_error(E_WARNING, "%s(): Unknown source charset: %c", get_active_function_name(TSRMLS_C), from);
break;
}
@@ -250,7 +250,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from,
case 'K':
break;
default:
- php_error(E_WARNING, "Unknown destination charset: %c", to);
+ php_error(E_WARNING, "%s(): Unknown destination charset: %c", get_active_function_name(TSRMLS_C), to);
break;
}
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index c902afbc00..cb78fc400c 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -300,7 +300,7 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
}
if (!ta) { /* that really shouldn't happen... */
- php_error(E_WARNING, "unexpected error in date()");
+ php_error(E_WARNING, "%s(): Unexpected error", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
for (i = 0; i < Z_STRLEN_PP(format); i++) {
@@ -630,12 +630,12 @@ PHP_FUNCTION(localtime)
break;
}
if (NULL == (ta = php_localtime_r(&timestamp, &tmbuf))) {
- php_error(E_WARNING, "%s(): invalid local time",
+ php_error(E_WARNING, "%s(): Invalid local time",
get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
if (array_init(return_value) == FAILURE) {
- php_error(E_ERROR, "Cannot prepare return array from localtime");
+ php_error(E_ERROR, "%s(): Cannot prepare return array from localtime", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -682,11 +682,11 @@ PHP_FUNCTION(getdate)
ta = php_localtime_r(&timestamp, &tmbuf);
if (!ta) {
- php_error(E_WARNING, "Cannot perform date calculation");
+ php_error(E_WARNING, "%s(): Cannot perform date calculation", get_active_function_name(TSRMLS_C));
return;
}
if (array_init(return_value) == FAILURE) {
- php_error(E_ERROR, "Unable to initialize array");
+ php_error(E_ERROR, "%s(): Unable to initialize array", get_active_function_name(TSRMLS_C));
return;
}
add_assoc_long(return_value, "seconds", ta->tm_sec);
@@ -867,7 +867,7 @@ PHP_FUNCTION(strtotime)
convert_to_string_ex(z_time);
if (Z_STRLEN_PP(z_time) == 0)
- php_error (E_NOTICE, "strtotime() called with empty time parameter");
+ php_error (E_NOTICE, "%s(): Called with empty time parameter", get_active_function_name(TSRMLS_C));
if (argc == 2) {
convert_to_long_ex(z_now);
now = Z_LVAL_PP(z_now);
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 2f768a3d0e..423a9d10a7 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -75,7 +75,7 @@ static zend_class_entry *dir_class_entry_ptr;
myself = getThis(); \
if (myself) { \
if (zend_hash_find(Z_OBJPROP_P(myself), "handle", sizeof("handle"), (void **)&tmp) == FAILURE) { \
- php_error(E_WARNING, "unable to find my handle property"); \
+ php_error(E_WARNING, "%s(): Unable to find my handle property", get_active_function_name(TSRMLS_C)); \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(dirp, php_stream *, tmp, -1, "Directory", php_file_le_stream()); \
@@ -218,14 +218,14 @@ PHP_FUNCTION(chroot)
ret = chroot(str);
if (ret != 0) {
- php_error(E_WARNING, "chroot: %s (errno %d)", strerror(errno), errno);
+ php_error(E_WARNING, "%s(): %s (errno %d)", get_active_function_name(TSRMLS_C), strerror(errno), errno);
RETURN_FALSE;
}
ret = chdir("/");
if (ret != 0) {
- php_error(E_WARNING, "chdir: %s (errno %d)", strerror(errno), errno);
+ php_error(E_WARNING, "%s(): %s (errno %d)", get_active_function_name(TSRMLS_C), strerror(errno), errno);
RETURN_FALSE;
}
@@ -253,7 +253,7 @@ PHP_FUNCTION(chdir)
ret = VCWD_CHDIR(str);
if (ret != 0) {
- php_error(E_WARNING, "ChDir: %s (errno %d)", strerror(errno), errno);
+ php_error(E_WARNING, "%s(): %s (errno %d)", get_active_function_name(TSRMLS_C), strerror(errno), errno);
RETURN_FALSE;
}
@@ -337,7 +337,7 @@ PHP_FUNCTION(glob)
int n, ret;
if (PG(safe_mode)) {
- php_error(E_WARNING, "%s() SAFE MODE Restriction in effect, function is disabled",
+ php_error(E_WARNING, "%s(): Safe Mode restriction in effect, function is disabled",
get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index 6152f56deb..e17ccc4758 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -59,7 +59,7 @@ PHP_FUNCTION(dl)
#ifdef ZTS
if ((strcmp(sapi_module.name, "cgi")!=0) && (strcmp(sapi_module.name, "cli")!=0)) {
- php_error(E_ERROR, "dl() is not supported in multithreaded Web servers - use extension statements in your php.ini");
+ php_error(E_ERROR, "%s(): Not supported in multithreaded Web servers - use extension statements in your php.ini", get_active_function_name(TSRMLS_C));
}
#endif
@@ -71,9 +71,9 @@ PHP_FUNCTION(dl)
convert_to_string_ex(file);
if (!PG(enable_dl)) {
- php_error(E_ERROR, "Dynamically loaded extentions aren't enabled.");
+ php_error(E_ERROR, "%s(): Dynamically loaded extentions aren't enabled", get_active_function_name(TSRMLS_C));
} else if (PG(safe_mode)) {
- php_error(E_ERROR, "Dynamically loaded extensions aren't allowed when running in SAFE MODE.");
+ php_error(E_ERROR, "%s(): Dynamically loaded extensions aren't allowed when running in Safe Mode", get_active_function_name(TSRMLS_C));
} else {
php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC);
EG(full_tables_cleanup) = 1;
@@ -134,7 +134,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
/* load dynamic symbol */
handle = DL_LOAD(libpath);
if (!handle) {
- php_error(error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR());
+ php_error(error_type, "%s(): Unable to load dynamic library '%s' - %s", get_active_function_name(TSRMLS_C), libpath, GET_DL_ERROR());
efree(libpath);
RETURN_FALSE;
}
@@ -155,7 +155,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
if (!get_module) {
DL_UNLOAD(handle);
- php_error(error_type, "Invalid library (maybe not a PHP library) '%s' ", Z_STRVAL_P(file));
+ php_error(error_type, "%s(): Invalid library (maybe not a PHP library) '%s' ", get_active_function_name(TSRMLS_C), Z_STRVAL_P(file));
RETURN_FALSE;
}
module_entry = get_module();
@@ -213,7 +213,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
module_entry->module_number = zend_next_free_module();
if (module_entry->module_startup_func) {
if (module_entry->module_startup_func(type, module_entry->module_number TSRMLS_CC)==FAILURE) {
- php_error(error_type, "%s: Unable to initialize module", module_entry->name);
+ php_error(error_type, "%s(): Unable to initialize module '%s'", get_active_function_name(TSRMLS_C), module_entry->name);
DL_UNLOAD(handle);
RETURN_FALSE;
}
@@ -222,7 +222,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
if ((type == MODULE_TEMPORARY) && module_entry->request_startup_func) {
if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC)) {
- php_error(error_type, "%s: Unable to initialize module", module_entry->name);
+ php_error(error_type, "%s(): Unable to initialize module '%s'", get_active_function_name(TSRMLS_C), module_entry->name);
DL_UNLOAD(handle);
RETURN_FALSE;
}
@@ -230,7 +230,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
/* update the .request_started property... */
if (zend_hash_find(&module_registry, module_entry->name, strlen(module_entry->name)+1, (void **) &tmp)==FAILURE) {
- php_error(error_type, "%s: Loaded module got lost", module_entry->name);
+ php_error(error_type, "%s(): Loaded module '%s' got lost", get_active_function_name(TSRMLS_C), module_entry->name);
RETURN_FALSE;
}
tmp->handle = handle;
@@ -248,7 +248,7 @@ PHP_MINFO_FUNCTION(dl)
void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
{
- php_error(E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", Z_STRVAL_P(file));
+ php_error(E_WARNING, "%s(): Cannot dynamically load %s - dynamic modules are not supported", get_active_function_name(TSRMLS_C), Z_STRVAL_P(file));
RETURN_FALSE;
}
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index f2efa21867..b56ab392a3 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -85,9 +85,9 @@ PHP_FUNCTION(gethostbyaddr)
#if HAVE_IPV6 && !defined(__MacOSX__)
/* MacOSX at this time has support for IPv6, but not inet_pton()
* so disabling IPv6 until further notice. MacOSX 10.1.2 (kalowsky) */
- php_error(E_WARNING, "Address is not a valid IPv4 or IPv6 address");
+ php_error(E_WARNING, "%s(): Address is not a valid IPv4 or IPv6 address", get_active_function_name(TSRMLS_C));
#else
- php_error(E_WARNING, "Address is not in a.b.c.d form");
+ php_error(E_WARNING, "%s(): Address is not in a.b.c.d form", get_active_function_name(TSRMLS_C));
#endif
RETVAL_FALSE;
} else {
@@ -236,7 +236,7 @@ PHP_FUNCTION(checkdnsrr)
else if ( !strcasecmp("SOA", Z_STRVAL_PP(arg2)) ) type = T_SOA;
else if ( !strcasecmp("CNAME", Z_STRVAL_PP(arg2)) ) type = T_CNAME;
else {
- php_error(E_WARNING, "Type '%s' not supported", Z_STRVAL_PP(arg2));
+ php_error(E_WARNING, "%s(): Type '%s' not supported", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(arg2));
RETURN_FALSE;
}
break;
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 839d09a7a1..e0d9b2921d 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -124,7 +124,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
buf = (char *) emalloc(EXEC_INPUT_BUF);
if (!buf) {
- php_error(E_WARNING, "Unable to emalloc %d bytes for exec buffer", EXEC_INPUT_BUF);
+ php_error(E_WARNING, "%s(): Unable to emalloc %d bytes for exec buffer", get_active_function_name(TSRMLS_C), EXEC_INPUT_BUF);
return -1;
}
buflen = EXEC_INPUT_BUF;
@@ -137,7 +137,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
c = strchr(cmd, ' ');
if (c) *c = '\0';
if (strstr(cmd, "..")) {
- php_error(E_WARNING, "No '..' components allowed in path");
+ php_error(E_WARNING, "%s(): No '..' components allowed in path", get_active_function_name(TSRMLS_C));
efree(buf);
return -1;
}
@@ -169,7 +169,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
fp = VCWD_POPEN(d, "r");
#endif
if (!fp) {
- php_error(E_WARNING, "Unable to fork [%s]", d);
+ php_error(E_WARNING, "%s(): Unable to fork [%s]", get_active_function_name(TSRMLS_C), d);
efree(d);
efree(buf);
#if PHP_SIGCHILD
@@ -188,7 +188,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
fp = VCWD_POPEN(cmd, "r");
#endif
if (!fp) {
- php_error(E_WARNING, "Unable to fork [%s]", cmd);
+ php_error(E_WARNING, "%s(): Unable to fork [%s]", get_active_function_name(TSRMLS_C), cmd);
efree(buf);
#if PHP_SIGCHILD
signal (SIGCHLD, sig_handler);
@@ -219,7 +219,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
if ( buflen <= (l+1) ) {
buf = erealloc(buf, buflen + EXEC_INPUT_BUF);
if ( buf == NULL ) {
- php_error(E_WARNING, "Unable to erealloc %d bytes for exec buffer",
+ php_error(E_WARNING, "%s(): Unable to erealloc %d bytes for exec buffer", get_active_function_name(TSRMLS_C),
buflen + EXEC_INPUT_BUF);
#if PHP_SIGCHILD
signal (SIGCHLD, sig_handler);
@@ -514,7 +514,7 @@ PHP_FUNCTION(shell_exec)
}
if (PG(safe_mode)) {
- php_error(E_WARNING, "Cannot execute using backquotes in safe mode");
+ php_error(E_WARNING, "%s(): Cannot execute using backquotes in Safe Mode", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -524,7 +524,7 @@ PHP_FUNCTION(shell_exec)
#else
if ((in=VCWD_POPEN(Z_STRVAL_PP(cmd), "r"))==NULL) {
#endif
- php_error(E_WARNING, "Unable to execute '%s'", Z_STRVAL_PP(cmd));
+ php_error(E_WARNING, "%s(): Unable to execute '%s'", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(cmd));
RETURN_FALSE;
}
allocated_space = EXEC_INPUT_BUF;
@@ -742,7 +742,7 @@ PHP_FUNCTION(proc_open)
descriptors[ndesc].mode = DESC_FILE;
} else if (Z_TYPE_PP(descitem) != IS_ARRAY) {
- zend_error(E_WARNING, "%s(): descriptor item must be either an array or a File-Handle",
+ php_error(E_WARNING, "%s(): Descriptor item must be either an array or a File-Handle",
get_active_function_name(TSRMLS_C));
goto exit_fail;
} else {
@@ -750,7 +750,7 @@ PHP_FUNCTION(proc_open)
if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 0, (void **)&ztype) == SUCCESS) {
convert_to_string_ex(ztype);
} else {
- php_error (E_WARNING, "%s(): Missing handle qualifier in array",
+ php_error (E_WARNING, "%s(): Missing handle qualifier in array",
get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype));
goto exit_fail;
}
@@ -762,7 +762,7 @@ PHP_FUNCTION(proc_open)
if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 1, (void **)&zmode) == SUCCESS) {
convert_to_string_ex(zmode);
} else {
- php_error (E_WARNING, "%s(): Missing mode parameter for 'pipe'",
+ php_error (E_WARNING, "%s(): Missing mode parameter for 'pipe'",
get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype));
goto exit_fail;
}
@@ -806,7 +806,7 @@ PHP_FUNCTION(proc_open)
if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 1, (void **)&zfile) == SUCCESS) {
convert_to_string_ex(zfile);
} else {
- php_error (E_WARNING, "%s(): Missing file name parameter for 'file'",
+ php_error (E_WARNING, "%s(): Missing file name parameter for 'file'",
get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype));
goto exit_fail;
}
@@ -814,7 +814,7 @@ PHP_FUNCTION(proc_open)
if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 2, (void **)&zmode) == SUCCESS) {
convert_to_string_ex(zmode);
} else {
- php_error (E_WARNING, "%s(): Missing mode parameter for 'file'",
+ php_error (E_WARNING, "%s(): Missing mode parameter for 'file'",
get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype));
goto exit_fail;
}
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 1e7e3d8a9a..c7b53e8ae0 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -218,7 +218,7 @@ PHP_FUNCTION(flock)
act = Z_LVAL_PP(arg2) & 3;
if (act < 1 || act > 3) {
- php_error(E_WARNING, "Illegal operation argument");
+ php_error(E_WARNING, "%s(): Illegal operation argument", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -888,13 +888,13 @@ PHP_FUNCTION(popen)
efree(tmp);
if (!fp) {
- php_error(E_WARNING, "popen(\"%s\", \"%s\") - %s", buf, p, strerror(errno));
+ php_error(E_WARNING, "%s(\"%s\", \"%s\") - %s", get_active_function_name(TSRMLS_C), buf, p, strerror(errno));
RETURN_FALSE;
}
} else {
fp = VCWD_POPEN(Z_STRVAL_PP(arg1), p);
if (!fp) {
- php_error(E_WARNING, "popen(\"%s\", \"%s\") - %s", Z_STRVAL_PP(arg1), p, strerror(errno));
+ php_error(E_WARNING, "%s(\"%s\", \"%s\") - %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(arg1), p, strerror(errno));
efree(p);
RETURN_FALSE;
}
@@ -967,7 +967,7 @@ PHPAPI int php_set_sock_blocking(int socketd, int block)
/* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */
flags = !block;
if (ioctlsocket(socketd, FIONBIO, &flags)==SOCKET_ERROR){
- php_error(E_WARNING, "%s", WSAGetLastError());
+ php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), WSAGetLastError());
ret = FALSE;
}
#else
@@ -1028,7 +1028,7 @@ PHP_FUNCTION(socket_set_blocking)
Set blocking/non-blocking mode on a socket */
PHP_FUNCTION(set_socket_blocking)
{
- php_error(E_NOTICE, "set_socket_blocking() is deprecated, use socket_set_blocking() instead");
+ php_error(E_NOTICE, "%s(): This function is deprecated, use socket_set_blocking() instead", get_active_function_name(TSRMLS_C));
PHP_FN(socket_set_blocking)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
@@ -1132,7 +1132,7 @@ PHPAPI PHP_FUNCTION(fgets)
}
if (len < 0) {
- php_error(E_WARNING, "length parameter to fgets() may not be negative");
+ php_error(E_WARNING, "%s(): Length parameter may not be negative", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -1231,7 +1231,7 @@ PHPAPI PHP_FUNCTION(fgetss)
convert_to_long_ex(bytes);
len = Z_LVAL_PP(bytes);
if (len < 0) {
- php_error(E_WARNING, "length parameter to fgetss() may not be negative");
+ php_error(E_WARNING, "%s(): Length parameter may not be negative", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -1518,7 +1518,7 @@ PHP_FUNCTION(mkdir)
ret = VCWD_MKDIR(dir, (mode_t)mode);
if (ret < 0) {
- php_error(E_WARNING, "mkdir() failed (%s)", strerror(errno));
+ php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1548,7 +1548,7 @@ PHP_FUNCTION(rmdir)
ret = VCWD_RMDIR(Z_STRVAL_PP(arg1));
if (ret < 0) {
- php_error(E_WARNING, "rmdir() failed (%s)", strerror(errno));
+ php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno));
RETURN_FALSE;
}
@@ -1675,7 +1675,7 @@ PHP_FUNCTION(rename)
ret = VCWD_RENAME(old_name, new_name);
if (ret == -1) {
- php_error(E_WARNING, "rename() failed (%s)", strerror(errno));
+ php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno));
RETURN_FALSE;
}
@@ -1705,7 +1705,7 @@ PHP_FUNCTION(unlink)
ret = VCWD_UNLINK(Z_STRVAL_PP(filename));
if (ret == -1) {
- php_error(E_WARNING, "unlink() failed (%s)", strerror(errno));
+ php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno));
RETURN_FALSE;
}
/* Clear stat cache */
@@ -1734,7 +1734,7 @@ PHP_NAMED_FUNCTION(php_if_ftruncate)
convert_to_long_ex(size);
if (php_stream_is((php_stream*)what, PHP_STREAM_IS_SOCKET)) {
- php_error(E_WARNING, "can't truncate sockets!");
+ php_error(E_WARNING, "%s(): Can't truncate sockets!", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
if (SUCCESS == php_stream_cast((php_stream*)what, PHP_STREAM_AS_FD, (void*)&fd, 1)) {
@@ -1911,7 +1911,7 @@ PHPAPI PHP_FUNCTION(fread)
convert_to_long_ex(arg2);
len = Z_LVAL_PP(arg2);
if (len < 0) {
- php_error(E_WARNING, "length parameter to fread() may not be negative");
+ php_error(E_WARNING, "%s(): Length parameter may not be negative", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -1958,7 +1958,7 @@ PHP_FUNCTION(fgetcsv)
convert_to_string_ex(p_delim);
/* Make sure that there is at least one character in string */
if (Z_STRLEN_PP(p_delim) < 1) {
- php_error(E_WARNING, "%s() 3rd parameter must be a character",
+ php_error(E_WARNING, "%s(): Third parameter must be a character",
get_active_function_name(TSRMLS_C));
return;
}
@@ -1973,7 +1973,7 @@ PHP_FUNCTION(fgetcsv)
convert_to_string_ex(p_delim);
/* Make sure that there is at least one character in string */
if (Z_STRLEN_PP(p_delim) < 1) {
- php_error(E_WARNING, "%s() 3rd parameter must be a character",
+ php_error(E_WARNING, "%s(): Third parameter must be a character",
get_active_function_name(TSRMLS_C));
return;
}
@@ -1998,7 +1998,7 @@ PHP_FUNCTION(fgetcsv)
convert_to_long_ex(bytes);
len = Z_LVAL_PP(bytes);
if (len < 0) {
- php_error(E_WARNING, "length parameter to fgetcsv() may not be negative");
+ php_error(E_WARNING, "%s(): Length parameter may not be negative", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index b9d060e3ef..382847344a 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -198,7 +198,7 @@ PHP_FUNCTION(disk_total_space)
}
}
else {
- php_error(E_WARNING, "Unable to load kernel32.dll");
+ php_error(E_WARNING, "%s(): Unable to load kernel32.dll", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -301,7 +301,7 @@ PHP_FUNCTION(disk_free_space)
}
}
else {
- php_error(E_WARNING, "Unable to load kernel32.dll");
+ php_error(E_WARNING, "%s(): Unable to load kernel32.dll", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -348,7 +348,7 @@ PHP_FUNCTION(chgrp)
if (Z_TYPE_PP(group) == IS_STRING) {
gr = getgrnam(Z_STRVAL_PP(group));
if (!gr) {
- php_error(E_WARNING, "unable to find gid for %s",
+ php_error(E_WARNING, "%s(): Unable to find gid for %s", get_active_function_name(TSRMLS_C),
Z_STRVAL_PP(group));
RETURN_FALSE;
}
@@ -369,7 +369,7 @@ PHP_FUNCTION(chgrp)
ret = VCWD_CHOWN(Z_STRVAL_PP(filename), -1, gid);
if (ret == -1) {
- php_error(E_WARNING, "chgrp failed: %s", strerror(errno));
+ php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -396,7 +396,7 @@ PHP_FUNCTION(chown)
if (Z_TYPE_PP(user) == IS_STRING) {
pw = getpwnam(Z_STRVAL_PP(user));
if (!pw) {
- php_error(E_WARNING, "unable to find uid for %s",
+ php_error(E_WARNING, "%s(): Unable to find uid for %s", get_active_function_name(TSRMLS_C),
Z_STRVAL_PP(user));
RETURN_FALSE;
}
@@ -417,7 +417,7 @@ PHP_FUNCTION(chown)
ret = VCWD_CHOWN(Z_STRVAL_PP(filename), uid, -1);
if (ret == -1) {
- php_error(E_WARNING, "chown failed: %s", strerror(errno));
+ php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno));
RETURN_FALSE;
}
#endif
@@ -458,7 +458,7 @@ PHP_FUNCTION(chmod)
ret = VCWD_CHMOD(Z_STRVAL_PP(filename), imode);
if (ret == -1) {
- php_error(E_WARNING, "chmod failed: %s", strerror(errno));
+ php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -512,7 +512,7 @@ PHP_FUNCTION(touch)
if (ret == -1) {
file = VCWD_FOPEN(Z_STRVAL_PP(filename), "w");
if (file == NULL) {
- php_error(E_WARNING, "unable to create file %s because %s", Z_STRVAL_PP(filename), strerror(errno));
+ php_error(E_WARNING, "%s(): Unable to create file %s because %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(filename), strerror(errno));
RETURN_FALSE;
}
fclose(file);
@@ -520,7 +520,7 @@ PHP_FUNCTION(touch)
ret = VCWD_UTIME(Z_STRVAL_PP(filename), newtime);
if (ret == -1) {
- php_error(E_WARNING, "utime failed: %s", strerror(errno));
+ php_error(E_WARNING, "%s(): Utime failed: %s", get_active_function_name(TSRMLS_C), strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -587,7 +587,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
#endif
if (VCWD_STAT(BG(CurrentStatFile), &BG(sb)) == -1) {
if (!IS_LINK_OPERATION(type) && (!IS_EXISTS_CHECK(type) || errno != ENOENT)) { /* fileexists() test must print no error */
- php_error(E_WARNING, "stat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno));
+ php_error(E_WARNING, "%s(): Stat failed for %s (errno=%d - %s)", get_active_function_name(TSRMLS_C), BG(CurrentStatFile), errno, strerror(errno));
}
efree(BG(CurrentStatFile));
BG(CurrentStatFile) = NULL;
@@ -602,7 +602,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
/* do lstat if the buffer is empty */
if (VCWD_LSTAT(filename, &BG(lsb)) == -1) {
if (!IS_EXISTS_CHECK(type) || errno != ENOENT) { /* fileexists() test must print no error */
- php_error(E_WARNING, "lstat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno));
+ php_error(E_WARNING, "%s(): Lstat failed for %s (errno=%d - %s)", get_active_function_name(TSRMLS_C), BG(CurrentStatFile), errno, strerror(errno));
}
RETURN_FALSE;
}
@@ -673,7 +673,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
case S_IFSOCK: RETURN_STRING("socket", 1);
#endif
}
- php_error(E_WARNING, "Unknown file type (%d)", BG(sb).st_mode&S_IFMT);
+ php_error(E_WARNING, "%s(): Unknown file type (%d)", get_active_function_name(TSRMLS_C), BG(sb).st_mode&S_IFMT);
RETURN_STRING("unknown", 1);
case FS_IS_W:
if (getuid()==0) {
@@ -770,7 +770,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
return;
}
- php_error(E_WARNING, "didn't understand stat call");
+ php_error(E_WARNING, "%s(): Didn't understand stat call", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
/* }}} */
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index b2dc5cb700..4657ce86e1 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -475,7 +475,7 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
if (currarg >= argc && format[inpos + 1] != '%') {
efree(result);
efree(args);
- php_error(E_WARNING, "%s(): too few arguments", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): Too few arguments", get_active_function_name(TSRMLS_C));
return NULL;
}
/* starting a new format specifier, reset variables */
@@ -496,7 +496,7 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
if (argnum == 0) {
efree(result);
efree(args);
- php_error(E_WARNING, "%s(): zero is not a valid argument number", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): Zero is not a valid argument number", get_active_function_name(TSRMLS_C));
return NULL;
}
@@ -507,7 +507,7 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
if (argnum >= argc) {
efree(result);
efree(args);
- php_error(E_WARNING, "%s(): too few arguments", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): Too few arguments", get_active_function_name(TSRMLS_C));
return NULL;
}
diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c
index 9ff67cd136..a472bc3248 100644
--- a/ext/standard/ftok.c
+++ b/ext/standard/ftok.c
@@ -41,12 +41,12 @@ PHP_FUNCTION(ftok)
convert_to_string_ex(proj);
if (Z_STRLEN_PP(pathname)==0){
- php_error(E_WARNING, "Invalid argument 1 in ftok");
+ php_error(E_WARNING, "%s(): First argument invalid", get_active_function_name(TSRMLS_C));
RETURN_LONG(-1);
}
if (Z_STRLEN_PP(proj)!=1){
- php_error(E_WARNING, "Invalid argument 2 in ftok");
+ php_error(E_WARNING, "%s(): Second argument invalid", get_active_function_name(TSRMLS_C));
RETURN_LONG(-1);
}
diff --git a/ext/standard/head.c b/ext/standard/head.c
index d8cc5345c0..81236de737 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -158,7 +158,7 @@ PHP_FUNCTION(setcookie)
PHP_FUNCTION(headers_sent)
{
if (ZEND_NUM_ARGS() != 0) {
- php_error(E_WARNING, "%s() expects no parameters, %d given",
+ php_error(E_WARNING, "%s(): No parameters expected, %d given",
get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS());
return;
}
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 12eafcde6f..cf9bf039d7 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -749,7 +749,8 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
{
char *str, *hint_charset = NULL;
- int str_len, hint_charset_len, len, quote_style = ENT_COMPAT;
+ int str_len, hint_charset_len = 0;
+ int len, quote_style = ENT_COMPAT;
char *replaced;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len,
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 51a331ae0c..b579da9ed7 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -807,7 +807,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
if ( !filetype) filetype = tmp;
if((php_stream_read(stream, filetype, 3)) <= 0) {
- php_error(E_WARNING, "getimagesize: Read error!");
+ php_error(E_WARNING, "%s(): Read error!", get_active_function_name(TSRMLS_C));
return IMAGE_FILETYPE_UNKNOWN;
}
@@ -820,7 +820,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
if (!memcmp(filetype, php_sig_png, 8)) {
return IMAGE_FILETYPE_PNG;
} else {
- php_error(E_WARNING, "PNG file corrupted by ASCII conversion");
+ php_error(E_WARNING, "%s(): PNG file corrupted by ASCII conversion", get_active_function_name(TSRMLS_C));
return IMAGE_FILETYPE_UNKNOWN;
}
} else if (!memcmp(filetype, php_sig_swf, 3)) {
@@ -941,7 +941,7 @@ PHP_FUNCTION(getimagesize)
if (result) {
if (array_init(return_value) == FAILURE) {
- php_error(E_ERROR, "Unable to initialize array");
+ php_error(E_ERROR, "%s(): Unable to initialize array", get_active_function_name(TSRMLS_C));
efree(result);
return;
}
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index e94be6d875..a29573be72 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -213,7 +213,7 @@ PHP_FUNCTION(iptcembed)
}
if ((fp = VCWD_FOPEN(Z_STRVAL_PP(jpeg_file), "rb")) == 0) {
- php_error(E_WARNING, "Unable to open %s", Z_STRVAL_PP(jpeg_file));
+ php_error(E_WARNING, "%s(): Unable to open %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(jpeg_file));
RETURN_FALSE;
}
@@ -354,7 +354,7 @@ PHP_FUNCTION(iptcparse)
if (tagsfound == 0) { /* found the 1st tag - initialize the return array */
if (array_init(return_value) == FAILURE) {
- php_error(E_ERROR, "Unable to initialize array");
+ php_error(E_ERROR, "%s(): Unable to initialize array", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
}
@@ -363,7 +363,7 @@ PHP_FUNCTION(iptcparse)
ALLOC_ZVAL(values);
INIT_PZVAL(values);
if (array_init(values) == FAILURE) {
- php_error(E_ERROR, "Unable to initialize array");
+ php_error(E_ERROR, "%s(): Unable to initialize array", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index f5c23687cf..eeedd4359a 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -138,7 +138,7 @@ PHP_FUNCTION(levenshtein)
}
if(distance<0) {
- php_error(E_WARNING, "levenshtein(): argument string(s) too long");
+ php_error(E_WARNING, "%s(): Argument string(s) too long", get_active_function_name(TSRMLS_C));
}
RETURN_LONG(distance);