Skip to content

Commit 5d903f6

Browse files
committed
fixed an issue with passing by reference.
1 parent 236b93f commit 5d903f6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Toby/Base.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ public function content_type($type = null, $params = array())
6969

7070
public function error()
7171
{
72-
$codes = (func_num_args() > 1)? array_shift(func_get_args()) : array("all");
72+
$args = func_get_args();
73+
$codes = (count($args) > 1)? array_shift($args) : array("all");
7374
if(!is_array($codes)) $codes = array($codes);
74-
$block = array_pop(func_get_args());
75+
$block = array_pop($args);
7576
foreach($codes as $code) $this->errors[$code] = $block;
7677
}
7778

0 commit comments

Comments
 (0)