Commit
…utes when calling render() to make the call works with or without a reverse proxy (closes #2941)
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,14 @@ public function render($controller, array $options = array()) | |
'comment' => '', | ||
), $options); | ||
|
||
// enforce all attribute values to be scalars to be sure that the same | ||
// render() call will work with or without a reverse proxy | ||
foreach ($options['attributes'] as $key => $value) { | ||
if (!is_scalar($value)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lsmith77
Contributor
|
||
throw new \InvalidArgumentException(sprintf('Unable to render the "%s" controller as the "%s" attribute is not a scalar.', $controller, $key)); | ||
} | ||
} | ||
|
||
if (!is_array($options['alt'])) { | ||
$options['alt'] = array($options['alt']); | ||
} | ||
|
shouldn't arrays of scalar values be allowed too ? they can be passed through an HTTP request