Commit 3df726de authored by Alexander Butenko's avatar Alexander Butenko

Merge pull request #472 from avbdr/master

fixes
parents a62e491a ff09f83e
......@@ -887,7 +887,7 @@ class MysqliDb
if (is_array($customFields)) {
foreach ($customFields as $key => $value) {
$customFields[$key] = preg_replace("/[^-a-z0-9\.\(\),_`]+/i", '', $value);
$customFields[$key] = preg_replace("/[^-a-z0-9\.\(\),_` ]+/i", '', $value);
}
$orderByField = 'FIELD (' . $orderByField . ', "' . implode('","', $customFields) . '")';
......@@ -1265,7 +1265,11 @@ class MysqliDb
$value = $tableData[$column];
if (!$isInsert) {
$this->_query .= "`" . $column . "` = ";
if(strpos($column,'.')===false) {
$this->_query .= "`" . $column . "` = ";
} else {
$this->_query .= str_replace('.','.`',$column) . "` = ";
}
}
// Subquery value
......
......@@ -401,11 +401,15 @@ class dbObject {
$joinObj = new $objectName;
if (!$key)
$key = $objectName . "id";
if (!$primaryKey)
$primaryKey = $joinObj->primaryKey;
if (!$primaryKey)
$primaryKey = MysqliDb::$prefix . $joinObj->dbTable . "." . $joinObj->primaryKey;
$joinStr = MysqliDb::$prefix . $this->dbTable . ".{$key} = " .
MysqliDb::$prefix . "{$joinObj->dbTable}.{$primaryKey}";
if (!strchr ($key, '.'))
$joinStr = MysqliDb::$prefix . $this->dbTable . ".{$key} = " . $primaryKey;
else
$joinStr = MysqliDb::$prefix . "{$key} = " . $primaryKey;
$this->db->join ($joinObj->dbTable, $joinStr, $joinType);
return $this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment