Fix MysqlWP
parent
4cdecfabd5
commit
ac253419cb
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* DatabaseMysql API shim for Wordpress
|
||||
* Version: 2018-09-10
|
||||
* Version: 2018-09-12
|
||||
* (c) Vitaliy Filippov, 2012-2018
|
||||
*/
|
||||
|
||||
|
@ -116,7 +116,7 @@ class DatabaseMysqlWP extends MysqlQueryBuilder
|
|||
if (!$rows)
|
||||
return false;
|
||||
global $wpdb;
|
||||
return $wpdb->query($this->update_builder($tables, $rows, $where, $options));
|
||||
return $wpdb->query($this->update_builder($table, $rows, $where, $options));
|
||||
}
|
||||
|
||||
function insert($table, $rows, $onConflict = NULL, $uniqueKey = NULL)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
* Use it freely under the terms of GNU GPLv2 or later license
|
||||
*
|
||||
* Version: 2018-09-10
|
||||
* Version: 2018-09-12
|
||||
* (c) Vitaliy Filippov 2012-2018
|
||||
*/
|
||||
abstract class MysqlQueryBuilder
|
||||
|
@ -328,17 +328,10 @@ abstract class MysqlQueryBuilder
|
|||
$tables = $t;
|
||||
}
|
||||
else
|
||||
$tables = preg_replace_callback('/((?:,|JOIN)\s*`)([^`]+)/s', [ $this, 'tables_builder_pregcb1' ], $tables);
|
||||
$tables = (isset($this->tableNames[$tables]) ? $this->quoteId($this->tableNames[$tables]) : $tables);
|
||||
return $tables;
|
||||
}
|
||||
|
||||
function tables_builder_pregcb1($m)
|
||||
{
|
||||
if (isset($this->tableNames[$m[2]]))
|
||||
return $m[1].$this->tableNames[$m[2]];
|
||||
return $m[1].$m[2];
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a set of rows.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue