Commit d2f35900 authored by Taylor Otwell's avatar Taylor Otwell

fix where in shortcut and response header casing problem.

parent b72f4e9f
...@@ -397,22 +397,24 @@ class Grammar extends \Laravel\Database\Grammar { ...@@ -397,22 +397,24 @@ class Grammar extends \Laravel\Database\Grammar {
* @param array $bindings * @param array $bindings
* @return string * @return string
*/ */
public function shortcut($sql, $bindings) public function shortcut($sql, &$bindings)
{ {
// Laravel provides an easy short-cut notation for writing raw WHERE IN // Laravel provides an easy short-cut notation for writing raw WHERE IN
// statements. If (...) is in the query, it will be replaced with the // statements. If (...) is in the query, it will be replaced with the
// correct number of parameters based on the bindings. // correct number of parameters based on the query bindings.
if (strpos($sql, '(...)') !== false) if (strpos($sql, '(...)') !== false)
{ {
for ($i = 0; $i < count($bindings); $i++) for ($i = 0; $i < count($bindings); $i++)
{ {
// If the binding is an array, we can just assume it's used to // If the binding is an array, we can just assume it's used to fill a
// fill a "where in" condition, so we will just replace the // where in condition, so we'll just replace the next place-holder
// next place-holder in the query with the constraint. // in the query with the constraint and splice the bindings.
if (is_array($bindings[$i])) if (is_array($bindings[$i]))
{ {
$parameters = $this->parameterize($bindings[$i]); $parameters = $this->parameterize($bindings[$i]);
array_splice($bindings, $i, 1, $bindings[$i]);
$sql = preg_replace('~\(\.\.\.\)~', "({$parameters})", $sql, 1); $sql = preg_replace('~\(\.\.\.\)~', "({$parameters})", $sql, 1);
} }
} }
......
...@@ -89,7 +89,7 @@ class Response { ...@@ -89,7 +89,7 @@ class Response {
{ {
$this->status = $status; $this->status = $status;
$this->content = $content; $this->content = $content;
$this->headers = $headers; $this->headers = array_change_key_case($headers);
} }
/** /**
......
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