@@ -171,14 +171,10 @@ public function _build_query_string($sQuery = '') {
171171 } elseif (is_null ($ sValue ) || (is_string ($ sValue ) && (strcmp ($ sValue , '#NULL# ' ) == 0 ))) {
172172 $ sTxt = 'NULL ' ;
173173 } elseif (is_array ($ sValue )) {
174- if (isset ($ sValue ['SQL ' ])) {
175- $ sTxt = $ sValue ['SQL ' ];
176- } else {
177- $ sTxt = '' ;
178- foreach ($ sValue as $ sVal ) $ sTxt .= ', \'' . $ this ->escape ($ sVal ) . '\'' ;
179- $ sTxt = '( ' . substr ($ sTxt , 1 ) . ') ' ;
180- if ($ sTxt == '() ' ) $ sTxt = '(0) ' ;
181- }
174+ $ sTxt = '' ;
175+ foreach ($ sValue as $ sVal ) $ sTxt .= ', \'' . $ this ->escape ($ sVal ) . '\'' ;
176+ $ sTxt = '( ' . substr ($ sTxt , 1 ) . ') ' ;
177+ if ($ sTxt == '() ' ) $ sTxt = '(0) ' ;
182178 } else {
183179 $ sTxt = '\'' . $ this ->escape ($ sValue ) . '\'' ;
184180 }
@@ -258,7 +254,7 @@ private function securityScan($string) {
258254
259255 private function _query ($ sQuery = '' ) {
260256 global $ app ;
261-
257+
262258 $ aArgs = func_get_args ();
263259
264260 if ($ sQuery == '' ) {
@@ -354,7 +350,7 @@ public function query($sQuery = '') {
354350 * @return array result row or NULL if none found
355351 */
356352 public function queryOneRecord ($ sQuery = '' ) {
357-
353+
358354 $ aArgs = func_get_args ();
359355 if (!empty ($ aArgs )) {
360356 $ sQuery = array_shift ($ aArgs );
@@ -363,7 +359,7 @@ public function queryOneRecord($sQuery = '') {
363359 }
364360 array_unshift ($ aArgs , $ sQuery );
365361 }
366-
362+
367363 $ oResult = call_user_func_array ([&$ this , 'query ' ], $ aArgs );
368364 if (!$ oResult ) return null ;
369365
@@ -750,7 +746,7 @@ public function datalogInsert($tablename, $insert_data, $index_field) {
750746 foreach ($ insert_data as $ key => $ val ) {
751747 $ key_str .= '??, ' ;
752748 $ params [] = $ key ;
753-
749+
754750 $ val_str .= '?, ' ;
755751 $ v_params [] = $ val ;
756752 }
@@ -764,7 +760,7 @@ public function datalogInsert($tablename, $insert_data, $index_field) {
764760 $ this ->query ("INSERT INTO ?? $ insert_data_str " , $ tablename );
765761 $ app ->log ("deprecated use of passing values to datalogInsert() - table " . $ tablename , 1 );
766762 }
767-
763+
768764 $ old_rec = array ();
769765 $ index_value = $ this ->insertID ();
770766 if (!$ index_value && isset ($ insert_data [$ index_field ])) {
@@ -1112,7 +1108,7 @@ public function mapType($metaType, $typeValue) {
11121108 * @access public
11131109 * @return string 'mariadb' or string 'mysql'
11141110 */
1115-
1111+
11161112 public function getDatabaseType () {
11171113 $ tmp = $ this ->queryOneRecord ('SELECT VERSION() as version ' );
11181114 if (stristr ($ tmp ['version ' ],'mariadb ' )) {
@@ -1140,7 +1136,7 @@ public function getDatabaseVersion($major_version_only = false) {
11401136 return $ version [0 ];
11411137 }
11421138 }
1143-
1139+
11441140 /**
11451141 * Get a mysql password hash
11461142 *
@@ -1150,9 +1146,9 @@ public function getDatabaseVersion($major_version_only = false) {
11501146 */
11511147
11521148 public function getPasswordHash ($ password ) {
1153-
1149+
11541150 $ password_type = 'password ' ;
1155-
1151+
11561152 /* Disabled until caching_sha2_password is implemented
11571153 if($this->getDatabaseType() == 'mysql' && $this->getDatabaseVersion(true) >= 8) {
11581154 // we are in MySQL 8 mode
@@ -1162,16 +1158,16 @@ public function getPasswordHash($password) {
11621158 }
11631159 }
11641160 */
1165-
1161+
11661162 if ($ password_type == 'caching_sha2_password ' ) {
11671163 /*
1168- caching_sha2_password hashing needs to be implemented, have not
1164+ caching_sha2_password hashing needs to be implemented, have not
11691165 found valid PHP implementation for the new password hash type.
11701166 */
11711167 } else {
11721168 $ password_hash = '* ' .strtoupper (sha1 (sha1 ($ password , true )));
11731169 }
1174-
1170+
11751171 return $ password_hash ;
11761172 }
11771173
0 commit comments