From e1255e087291928bea926d2c18adb1dbcb614c78 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Mon, 3 Apr 2017 17:46:06 +0900 Subject: [PATCH] DB IO: prepare pk null fix, split -> explode in Basic - Basic class still had a "split" call -> change that to explode - The prepare DB IO part missed setting pk name for the cursor to null so no returning is assumed --- www/libs/Class.Basic.inc | 4 ++-- www/libs/Class.DB.IO.inc | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/www/libs/Class.Basic.inc b/www/libs/Class.Basic.inc index 81f5d7ff..99284e60 100644 --- a/www/libs/Class.Basic.inc +++ b/www/libs/Class.Basic.inc @@ -1239,8 +1239,8 @@ return FALSE; // splits the data up with / or - - list ($start_year, $start_month, $start_day) = split('[/-]', $start_date); - list ($end_year, $end_month, $end_day) = split('[/-]', $end_date); + list ($start_year, $start_month, $start_day) = explode('[/-]', $start_date); + list ($end_year, $end_month, $end_day) = explode('[/-]', $end_date); // check that month & day are two digits and then combine foreach (array('start', 'end') as $prefix) { diff --git a/www/libs/Class.DB.IO.inc b/www/libs/Class.DB.IO.inc index b7592cb1..e622f191 100644 --- a/www/libs/Class.DB.IO.inc +++ b/www/libs/Class.DB.IO.inc @@ -1423,6 +1423,10 @@ $this->prepare_cursor[$stm_name]['returning_id'] = true; } } + else + { + $this->prepare_cursor[$stm_name]['pk_name'] = $pk_name; + } } // search for $1, $2, in the query and push it into the control array preg_match_all('/(\$[0-9]{1,})/', $query, $match);