]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6' into PHP-7.0
authorChristoph M. Becker <cmb@php.net>
Wed, 27 Jul 2016 14:47:09 +0000 (16:47 +0200)
committerChristoph M. Becker <cmb@php.net>
Wed, 27 Jul 2016 14:48:29 +0000 (16:48 +0200)
# Resolved conflicts:
# ext/sqlite3/sqlite3.c

1  2 
NEWS
ext/sqlite3/sqlite3.c

diff --cc NEWS
index 241dcad604beee9fcc3bc5482d99f03a79e1406d,bd65b76d6b7e0bed15a7e5c810964b32bf8be676..abfb573c79eb23823479e49774a5fb18bd1d31bc
--- 1/NEWS
--- 2/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)
  
index 2cb6a5225c981d059df31313d14f0890907eea57,54ec73d6ac62167ae40272af8e7a198d7bf25a66..9c14dabc66367389307894453279290cc704facd
@@@ -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;
                }
  
  #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;