cvs: pecl /apc php_apc.c
| From: | Brian Shire | Date: | Fri, 29 Sep 2006 08:12:20 +0000 |
| Subject: | cvs: pecl /apc php_apc.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-6425@lists.php.net to get a copy of this message | ||
shire Fri Sep 29 08:12:20 2006 UTC
Modified files:
/pecl/apc php_apc.c
Log:
Corrected array_fetch bug introduced with array argument. (Making sure we attempt to convert
non-string/non-array keys to strings so we match expected functionality.)
http://cvs.php.net/viewvc.cgi/pecl/apc/php_apc.c?r1=3.114&r2=3.115&diff_format=u
Index: pecl/apc/php_apc.c
diff -u pecl/apc/php_apc.c:3.114 pecl/apc/php_apc.c:3.115
--- pecl/apc/php_apc.c:3.114 Thu Sep 28 21:22:09 2006
+++ pecl/apc/php_apc.c Fri Sep 29 08:12:20 2006
@@ -26,7 +26,7 @@
*/
-/* $Id: php_apc.c,v 3.114 2006/09/28 21:22:09 shire Exp $ */
+/* $Id: php_apc.c,v 3.115 2006/09/29 08:12:20 shire Exp $ */
#include "apc_zend.h"
#include "apc_cache.h"
@@ -166,7 +166,7 @@
#else
php_info_print_table_row(2, "Locking type", "File Locks");
#endif
- php_info_print_table_row(2, "Revision", "$Revision: 3.114 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 3.115 $");
php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
@@ -555,18 +555,22 @@
t = sapi_get_request_time(TSRMLS_C);
#endif
+ if(Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) {
+ convert_to_string(key);
+ }
+
if(Z_TYPE_P(key) == IS_STRING) {
strkey = Z_STRVAL_P(key);
strkey_len = Z_STRLEN_P(key);
if(!strkey_len) RETURN_FALSE;
- entry = apc_cache_user_find(apc_user_cache, strkey, strkey_len + 1, t);
- if(entry) {
- /* deep-copy returned shm zval to emalloc'ed return_value */
- apc_cache_fetch_zval(return_value, entry->data.user.val, apc_php_malloc, apc_php_free);
- apc_cache_release(apc_user_cache, entry);
- } else {
- RETURN_FALSE;
- }
+ entry = apc_cache_user_find(apc_user_cache, strkey, strkey_len + 1, t);
+ if(entry) {
+ /* deep-copy returned shm zval to emalloc'ed return_value */
+ apc_cache_fetch_zval(return_value, entry->data.user.val, apc_php_malloc,
apc_php_free);
+ apc_cache_release(apc_user_cache, entry);
+ } else {
+ RETURN_FALSE;
+ }
} else if(Z_TYPE_P(key) == IS_ARRAY) {
hash = Z_ARRVAL_P(key);
MAKE_STD_ZVAL(result);