[geeklog-hg] geeklog: Fixed a bug where DB_result function of MySQLi failed w...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Feb 11 05:51:16 EST 2014


changeset 9489:e2c864b3028d
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/e2c864b3028d
user: Kenji ITO <mystralkk at gmail.com>
date: Tue Feb 11 19:49:54 2014 +0900
description:
Fixed a bug where DB_result function of MySQLi failed when the third argument was not a number

diffstat:

 system/databases/mysqli.class.php |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 3f9e498c03a6 -r e2c864b3028d system/databases/mysqli.class.php
--- a/system/databases/mysqli.class.php	Mon Feb 10 18:36:46 2014 +0900
+++ b/system/databases/mysqli.class.php	Tue Feb 11 19:49:54 2014 +0900
@@ -580,9 +580,14 @@
         $retval = '';
 
         if ($recordset->data_seek($row)) {
-            $row = $recordset->fetch_row();
+            if (is_numeric($field)) {
+                $field = intval($field, 10);
+                $row = $recordset->fetch_row();
+            } else {
+                $row = $recordset->fetch_assoc();
+            }
 
-            if (($row !== NULL) AND ($field < count($row))) {
+            if (($row !== NULL) AND isset($row[$field])) {
                 $retval = $row[$field];
             }
         }



More information about the geeklog-cvs mailing list