mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
MFB: Improved parameter handling
This commit is contained in:
parent
9b9cd5421d
commit
f0240a0382
4 changed files with 12 additions and 16 deletions
|
@ -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", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue