iliaa           Tue Jul 27 12:40:43 2004 EDT

  Modified files:              
    /php-src/ext/sqlite sqlite.c 
  Log:
  Fixed bug 29395 (sqlite_escape_string() returns bogus data on empty 
  strings).
  
  Original Patch by: Tony
  
  
http://cvs.php.net/diff.php/php-src/ext/sqlite/sqlite.c?r1=1.146&r2=1.147&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.147
--- 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:43 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.147 2004/07/27 16:40:43 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.147 2004/07/27 16:40:43 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