mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
Improved parameter handling
This commit is contained in:
parent
cc42ff9fa2
commit
9220a5eda2
4 changed files with 12 additions and 16 deletions
|
@ -180,18 +180,17 @@ PHP_FUNCTION(apache_child_terminate)
|
|||
Get and set Apache request notes */
|
||||
PHP_FUNCTION(apache_note)
|
||||
{
|
||||
char *note_name, *note_val;
|
||||
char *note_name, *note_val = NULL;
|
||||
int note_name_len, note_val_len;
|
||||
char *old_val;
|
||||
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;
|
||||
}
|
||||
|
||||
old_val = (char *) table_get(((request_rec *)SG(server_context))->notes, note_name);
|
||||
|
||||
if (arg_count == 2) {
|
||||
if (note_val) {
|
||||
table_set(((request_rec *)SG(server_context))->notes, note_name, note_val);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue