summaryrefslogtreecommitdiff
path: root/sapi/apache2handler/php_functions.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-01-05 16:24:14 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-01-05 16:24:14 +0000
commit9220a5eda2ef93a28faf804197d76f5258fb873f (patch)
tree227b7b70e555456e7ced73feb144351eefb07bbe /sapi/apache2handler/php_functions.c
parentcc42ff9fa2b2936829098fc92eef331bbffbaf94 (diff)
downloadphp-git-9220a5eda2ef93a28faf804197d76f5258fb873f.tar.gz
Improved parameter handling
Diffstat (limited to 'sapi/apache2handler/php_functions.c')
-rw-r--r--sapi/apache2handler/php_functions.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index db64043402..e7dd7fed1b 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -221,12 +221,11 @@ PHP_FUNCTION(apache_response_headers)
PHP_FUNCTION(apache_note)
{
php_struct *ctx;
- char *note_name, *note_val;
+ char *note_name, *note_val = NULL;
int note_name_len, note_val_len;
char *old_note_val=NULL;
- int arg_count = ZEND_NUM_ARGS();
- if (zend_parse_parameters(arg_count TSRMLS_CC, "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
return;
}
@@ -234,7 +233,7 @@ PHP_FUNCTION(apache_note)
old_note_val = (char *) apr_table_get(ctx->r->notes, note_name);
- if (arg_count == 2) {
+ if (note_val) {
apr_table_set(ctx->r->notes, note_name, note_val);
}