summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>1999-09-03 14:17:10 +0000
committerAndrey Hristov <andrey@php.net>1999-09-03 14:17:10 +0000
commitf8d9ef14b5d9d35538e174d93feb709aeba0beac (patch)
treed1a5d85ef053d20d54a3ee5f94e8609dd51bc0d2
parent303558e6cfd26085f6e3a1f8efbe65c8b7ad538c (diff)
downloadphp-git-f8d9ef14b5d9d35538e174d93feb709aeba0beac.tar.gz
Fixed resource handling to conform to PHP4 guidelines.
-rw-r--r--ext/wddx/wddx.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 4516c8e2e6..a6ff11e4cf 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -734,7 +734,7 @@ PHP_FUNCTION(wddx_packet_start)
packet = emalloc(sizeof(wddx_packet));
if (!packet) {
- zend_error(E_WARNING, "Unable to allocate memory in php_wddx_packet_start");
+ zend_error(E_WARNING, "Unable to allocate memory in wddx_packet_start");
RETURN_FALSE;
}
@@ -749,8 +749,8 @@ PHP_FUNCTION(wddx_packet_start)
_php_wddx_packet_start(packet, NULL);
_php_wddx_add_chunk(packet, WDDX_STRUCT_S);
-
- RETURN_LONG(zend_list_insert(packet, le_wddx));
+
+ RETURN_RESOURCE(zend_list_insert(packet, le_wddx));
}
/* }}} */
@@ -768,7 +768,11 @@ PHP_FUNCTION(wddx_packet_end)
WRONG_PARAM_COUNT;
}
- convert_to_long(packet_id);
+ if (packet_id->type != IS_RESOURCE)
+ {
+ zend_error(E_WARNING, "Invalid packet ID in call to wddx_packet_end");
+ return;
+ }
id = packet_id->value.lval;
packet = zend_list_find(id, &type);
if (type!=le_wddx) {
@@ -812,7 +816,11 @@ PHP_FUNCTION(wddx_add_vars)
packet_id = args[0];
- convert_to_long(packet_id);
+ if (packet_id->type != IS_RESOURCE)
+ {
+ zend_error(E_WARNING, "Invalid packet ID in call to wddx_add_vars");
+ return;
+ }
id = packet_id->value.lval;
packet = zend_list_find(id, &type);
if (type!=le_wddx) {