Skip to content

Commit d2415e6

Browse files
committed
Params with empty array should be cached differently than params with arrays
1 parent 6a0648f commit d2415e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Mouf/Database/MagicQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function buildPreparedStatement(string $sql, array $parameters = []): str
137137
$sql = $this->getTwigEnvironment()->render($sql, $parameters);
138138
}
139139

140-
$availableParameterKeys = array_keys(array_filter($parameters, static function($param) { return $param !== null;}));
140+
$availableParameterKeys = array_keys(array_filter($parameters, static function($param) { return $param !== null && $param !== [];}));
141141
// We choose md4 because it is fast.
142142
$cacheKey = 'request_build_'.hash('md4', get_class($this->platform).'__'.$sql.'__'.implode('_/_', $availableParameterKeys));
143143
$newSql = $this->cache->fetch($cacheKey);

0 commit comments

Comments
 (0)