Skip to content

Commit d2f3590

Browse files
committed
fix where in shortcut and response header casing problem.
1 parent b72f4e9 commit d2f3590

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

laravel/database/query/grammars/grammar.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,22 +397,24 @@ public function delete(Query $query)
397397
* @param array $bindings
398398
* @return string
399399
*/
400-
public function shortcut($sql, $bindings)
400+
public function shortcut($sql, &$bindings)
401401
{
402402
// Laravel provides an easy short-cut notation for writing raw WHERE IN
403403
// statements. If (...) is in the query, it will be replaced with the
404-
// correct number of parameters based on the bindings.
404+
// correct number of parameters based on the query bindings.
405405
if (strpos($sql, '(...)') !== false)
406406
{
407407
for ($i = 0; $i < count($bindings); $i++)
408408
{
409-
// If the binding is an array, we can just assume it's used to
410-
// fill a "where in" condition, so we will just replace the
411-
// next place-holder in the query with the constraint.
409+
// If the binding is an array, we can just assume it's used to fill a
410+
// where in condition, so we'll just replace the next place-holder
411+
// in the query with the constraint and splice the bindings.
412412
if (is_array($bindings[$i]))
413413
{
414414
$parameters = $this->parameterize($bindings[$i]);
415415

416+
array_splice($bindings, $i, 1, $bindings[$i]);
417+
416418
$sql = preg_replace('~\(\.\.\.\)~', "({$parameters})", $sql, 1);
417419
}
418420
}

laravel/response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct($content, $status = 200, $headers = array())
8989
{
9090
$this->status = $status;
9191
$this->content = $content;
92-
$this->headers = $headers;
92+
$this->headers = array_change_key_case($headers);
9393
}
9494

9595
/**

0 commit comments

Comments
 (0)