内核更新
This commit is contained in:
@@ -412,13 +412,17 @@ abstract class Connection
|
||||
{
|
||||
if ($bind) {
|
||||
foreach ($bind as $key => $val) {
|
||||
$val = $this->quote(is_array($val) ? $val[0] : $val);
|
||||
$value = is_array($val) ? $val[0] : $val;
|
||||
$type = is_array($val) ? $val[1] : PDO::PARAM_STR;
|
||||
if (PDO::PARAM_STR == $type) {
|
||||
$value = $this->quote($value);
|
||||
}
|
||||
// 判断占位符
|
||||
$sql = is_numeric($key) ?
|
||||
substr_replace($sql, $val, strpos($sql, '?'), 1) :
|
||||
substr_replace($sql, $value, strpos($sql, '?'), 1) :
|
||||
str_replace(
|
||||
[':' . $key . ')', ':' . $key . ',', ':' . $key . ' '],
|
||||
[$val . ')', $val . ',', $val . ' '],
|
||||
[$value . ')', $value . ',', $value . ' '],
|
||||
$sql . ' ');
|
||||
}
|
||||
}
|
||||
@@ -736,7 +740,7 @@ abstract class Connection
|
||||
* @param bool $master 是否主库查询
|
||||
* @return string
|
||||
*/
|
||||
public function quote($str, $master = false)
|
||||
public function quote($str, $master = true)
|
||||
{
|
||||
$this->initConnect($master);
|
||||
return $this->linkID ? $this->linkID->quote($str) : $str;
|
||||
|
||||
Reference in New Issue
Block a user