summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-08-29 21:32:25 +0000
committerMarcus Boerger <helly@php.net>2003-08-29 21:32:25 +0000
commitadaf6429a7af599d726377c5c272489c41dbc833 (patch)
treebeb7a67d51bf698f38cc3499029cc3bc7e4e5d05 /ext/sqlite/sqlite.c
parentf3fd882aa42694f11bf74198c1635164c6ec78fd (diff)
downloadphp-git-adaf6429a7af599d726377c5c272489c41dbc833.tar.gz
Throw exception if user wants to pass arguments to an non existing constructor
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 52a5ea8509..ab431a9dc1 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -1663,7 +1663,7 @@ PHP_FUNCTION(sqlite_fetch_array)
}
/* }}} */
-/* {{{ proto object sqlite_fetch_object(resource result [, string class_name [, array ctor_params [, bool decode_binary]]])
+/* {{{ proto object sqlite_fetch_object(resource result [, string class_name [, NULL|array ctor_params [, bool decode_binary]]])
Fetches the next row from a result set as an object. */
/* note that you can do array(&$val) for param ctor_params */
PHP_FUNCTION(sqlite_fetch_object)
@@ -1768,6 +1768,8 @@ PHP_FUNCTION(sqlite_fetch_object)
if (fci.params) {
efree(fci.params);
}
+ } else if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
+ zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Class %s does not have a constructor use NULL for parameter ctor_params", class_name);
}
}
/* }}} */