Skip to content

Commit 03a27e3

Browse files
author
Ilia Alshanetsky
committed
Improved parameter parsing
1 parent caf9054 commit 03a27e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/sqlite/sqlite.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2357,7 +2357,7 @@ PHP_FUNCTION(sqlite_fetch_object)
23572357
zend_bool decode_binary = 1;
23582358
struct php_sqlite_result *res;
23592359
zval *object = getThis();
2360-
char *class_name;
2360+
char *class_name = NULL;
23612361
int class_name_len;
23622362
zend_class_entry *ce;
23632363
zval dataset;
@@ -2374,7 +2374,7 @@ PHP_FUNCTION(sqlite_fetch_object)
23742374
return;
23752375
}
23762376
RES_FROM_OBJECT_RESTORE_ERH(res, object, &error_handling);
2377-
if (!ZEND_NUM_ARGS()) {
2377+
if (!class_name) {
23782378
ce = zend_standard_class_def;
23792379
} else {
23802380
ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
@@ -2385,7 +2385,7 @@ PHP_FUNCTION(sqlite_fetch_object)
23852385
return;
23862386
}
23872387
ZEND_FETCH_RESOURCE(res, struct php_sqlite_result *, &zres, -1, "sqlite result", le_sqlite_result);
2388-
if (ZEND_NUM_ARGS() < 2) {
2388+
if (!class_name) {
23892389
ce = zend_standard_class_def;
23902390
} else {
23912391
ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);

0 commit comments

Comments
 (0)