|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-06-27 16:21 UTC] justin at voxel dot net
[2001-07-09 09:45 UTC] jeroen@php.net
[2001-07-16 10:09 UTC] zeev@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 21:00:02 2025 UTC |
An odd character seems to appear in the return value of create_function() (which should be of 'lambda_x' format where x is an integer). This character is causing eval() to crap out when trying to evaluate the created function. Just before the 'l' is a character that looks like Pi in the browser. The only way I knew to find out what it was was to urlencode() the return value and the strange character was encoded to '%00'. I'm no C coder, but the changes below seemed to fix things. *** /tmp/zend_builtin_functions.c Mon May 7 22:09:45 2001 --- /usr/local/src/php-4.0.5/Zend/zend_builtin_functions.c Mon May 7 22:03:31 2001 *************** *** 965,974 **** } function_add_ref(func); ! function_name = (char *) emalloc(sizeof("0lambda_")+MAX_LENGTH_OF_LONG); do { ! sprintf(function_name, "%clambda_%d", 0, ++EG(lambda_count)); function_name_length = strlen(function_name+1)+1; } while (zend_hash_add(EG(function_table), function_name, function_name_length+1, func, sizeof(zend_function), NULL)==FAILURE); zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME)); --- 965,974 ---- } function_add_ref(func); ! function_name = (char *) emalloc(sizeof("lambda_")+MAX_LENGTH_OF_LONG); do { ! sprintf(function_name, "lambda_%d", ++EG(lambda_count)); function_name_length = strlen(function_name+1)+1; } while (zend_hash_add(EG(function_table), function_name, function_name_length+1, func, sizeof(zend_function), NULL)==FAILURE); zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));