Skip to content

Commit

Permalink
fixed an issue with passing by reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamagokun committed Dec 20, 2013
1 parent 236b93f commit 5d903f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Toby/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ public function content_type($type = null, $params = array())

public function error()
{
$codes = (func_num_args() > 1)? array_shift(func_get_args()) : array("all");
$args = func_get_args();
$codes = (count($args) > 1)? array_shift($args) : array("all");
if(!is_array($codes)) $codes = array($codes);
$block = array_pop(func_get_args());
$block = array_pop($args);
foreach($codes as $code) $this->errors[$code] = $block;
}

Expand Down

0 comments on commit 5d903f6

Please sign in to comment.