diff options
author | Marcus Boerger <helly@php.net> | 2003-09-21 19:36:40 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-09-21 19:36:40 +0000 |
commit | 36655400cb76d849285b130d1f64613218948996 (patch) | |
tree | b2955b32f16fae9abbb8c8373801c00e48dd54c3 /ext/sqlite/sqlite.c | |
parent | 4f6874b3ff18ee732d54c2eb3b0e4640b3c81ef5 (diff) | |
download | php-git-36655400cb76d849285b130d1f64613218948996.tar.gz |
- return correct hash constants
- check for 'memory' in sqlite_factory() too (noticed by John Coggeshal)
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r-- | ext/sqlite/sqlite.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 06b72eb2e1..e33c22c153 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -757,7 +757,7 @@ typedef struct _sqlite_object { static int sqlite_free_persistent(list_entry *le, void *ptr TSRMLS_DC) { - return le->ptr == ptr; + return le->ptr == ptr ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_KEEP; } static void sqlite_object_dtor(void *object, zend_object_handle handle TSRMLS_DC) @@ -1172,14 +1172,16 @@ PHP_FUNCTION(sqlite_factory) zval_dtor(errmsg); } - if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - php_std_error_handling(); - RETURN_NULL(); - } - - if (php_check_open_basedir(filename TSRMLS_CC)) { - php_std_error_handling(); - RETURN_NULL(); + if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) { + if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + php_std_error_handling(); + RETURN_NULL(); + } + + if (php_check_open_basedir(filename TSRMLS_CC)) { + php_std_error_handling(); + RETURN_NULL(); + } } php_sqlite_open(filename, mode, NULL, return_value, errmsg, return_value TSRMLS_CC); |