Skip to content

Commit

Permalink
Restore php55 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jul 15, 2018
1 parent cddb08f commit 5ac36cd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/midcom/baseclasses/components/request.php
Expand Up @@ -384,10 +384,13 @@ public function get_router($component = null)
private function _prepare_handler(array $request)
{
$this->_handler =& $request;

$request['args'] = array_values(array_filter($request, function($item) {
return substr($item, 0, 1) !== '_';
}, ARRAY_FILTER_USE_KEY));
$args = [];
foreach ($request as $name => $value) {
if (substr($name, 0, 1) !== '_') {
$args[] = $value;
}
}
$request['args'] = $args;

if (strpos($request['_controller'], '::') === false) {
// Support for handlers in request class (deprecated)
Expand Down

0 comments on commit 5ac36cd

Please sign in to comment.