iliaa           Tue Jul 27 12:40:46 2004 EDT

  Modified files:              (Branch: PHP_5_0)
    /php-src    NEWS 
    /php-src/ext/sqlite sqlite.c 
  Log:
  MFH: Fixed bug 29395 (sqlite_escape_string() returns bogus data on empty
  strings).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.10&r2=1.1760.2.11&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.10 php-src/NEWS:1.1760.2.11
--- php-src/NEWS:1.1760.2.10    Mon Jul 26 03:22:00 2004
+++ php-src/NEWS        Tue Jul 27 12:40:46 2004
@@ -3,6 +3,8 @@
 ?? ??? 2004, PHP 5.0.1
 - Fixed unloading of dynamically loaded extensions. 
   (Marcus, kameshj at fastmail dot fm)
+- Fixed bug 29395 (sqlite_escape_string() returns bogus data on empty
+  strings). (Ilia, Tony)
 - Fixed bug #29368 (The destructor is called when an exception is thrown from 
   the constructor). (Marcus)
 - Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default) (Georg)
http://cvs.php.net/diff.php/php-src/ext/sqlite/sqlite.c?r1=1.146&r2=1.146.2.1&ty=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.146 php-src/ext/sqlite/sqlite.c:1.146.2.1
--- php-src/ext/sqlite/sqlite.c:1.146   Sat Jul 10 08:30:18 2004
+++ php-src/ext/sqlite/sqlite.c Tue Jul 27 12:40:46 2004
@@ -17,7 +17,7 @@
    |          Marcus Boerger <[EMAIL PROTECTED]>                              |
    +----------------------------------------------------------------------+
 
-   $Id: sqlite.c,v 1.146 2004/07/10 12:30:18 wez Exp $ 
+   $Id: sqlite.c,v 1.146.2.1 2004/07/27 16:40:46 iliaa Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1071,7 +1071,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "SQLite support", "enabled");
-       php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " 
$Id: sqlite.c,v 1.146 2004/07/10 12:30:18 wez Exp $");
+       php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " 
$Id: sqlite.c,v 1.146.2.1 2004/07/27 16:40:46 iliaa Exp $");
        php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
        php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
        php_info_print_table_end();
@@ -2680,12 +2680,14 @@
                enclen = php_sqlite_encode_binary(string, stringlen, ret+1);
                RETVAL_STRINGL(ret, enclen+1, 0);
                
-       } else  {
+       } else if (stringlen) {
                ret = sqlite_mprintf("%q", string);
                if (ret) {
                        RETVAL_STRING(ret, 1);
                        sqlite_freemem(ret);
                }
+       } else {
+               RETURN_EMPTY_STRING();
        }
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to