From: Christoph M. Becker Date: Wed, 27 Jul 2016 14:47:09 +0000 (+0200) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.0.10RC1~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23c359c27614a8b30afd860f2543912d1b297d08;p=php Merge branch 'PHP-5.6' into PHP-7.0 # Resolved conflicts: # ext/sqlite3/sqlite3.c --- 23c359c27614a8b30afd860f2543912d1b297d08 diff --cc NEWS index 241dcad604,bd65b76d6b..abfb573c79 --- a/NEWS +++ b/NEWS @@@ -65,29 -50,7 +65,31 @@@ PH . Fixed bug #72222 (ReflectionClass::export doesn't handle array constants). (Nikita Nefedov) +- SimpleXML: + . Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML + element). (Laruence) + +- SPL: + . Fixed bug #55701 (GlobIterator throws LogicException). (Valentin VĂLCIU) + . Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape + character). (cmb) + +- SQLite3: + . Fixed bug #72668 (Spurious warning when exception is thrown in user defined + function). (Laruence) + . Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash). (Laruence) ++ . Implemented FR #72653 (SQLite should allow opening with empty filename). ++ (cmb) + - Standard: + . Fixed bug #72622 (array_walk + array_replace_recursive create references + from nothing). (Laruence) + . Fixed bug #72152 (base64_decode $strict fails to detect null byte). + (Lauri Kenttä) + . Fixed bug #72263 (base64_decode skips a character after padding in strict + mode). (Lauri Kenttä) + . Fixed bug #72264 (base64_decode $strict fails with whitespace between + padding). (Lauri Kenttä) . Fixed bug #72330 (CSV fields incorrectly split if escape char followed by UTF chars). (cmb) diff --cc ext/sqlite3/sqlite3.c index 2cb6a5225c,54ec73d6ac..9c14dabc66 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@@ -110,17 -114,17 +110,15 @@@ PHP_METHOD(sqlite3, open return; } - zend_restore_error_handling(&error_handling TSRMLS_CC); - if (db_obj->initialised) { - zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC); + zend_throw_exception(zend_ce_exception, "Already initialised DB Object", 0); - } - - if (strlen(filename) != filename_len) { return; } - if (filename_len != sizeof(":memory:")-1 || - memcmp(filename, ":memory:", sizeof(":memory:")-1) != 0) { + + if (filename_len != 0 && (filename_len != sizeof(":memory:")-1 || + memcmp(filename, ":memory:", sizeof(":memory:")-1) != 0)) { - if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { - zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC); + if (!(fullpath = expand_filepath(filename, NULL))) { + zend_throw_exception(zend_ce_exception, "Unable to expand filepath", 0); return; } @@@ -146,8 -151,8 +145,8 @@@ #else if (sqlite3_open(fullpath, &(db_obj->db)) != SQLITE_OK) { #endif - zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Unable to open database: %s", sqlite3_errmsg(db_obj->db)); + zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db)); - if (fullpath) { + if (fullpath != filename) { efree(fullpath); } return;