Skip to content
Snippets Groups Projects
Commit 86b68399 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #1206 from protich/issue/ticket-number-sequence


Sanity check for callable check

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents fa1b763b 32d4210c
No related branches found
No related tags found
No related merge requests found
......@@ -42,11 +42,17 @@ class Sequence extends VerySimpleModel {
*/
function next($format=false, $check=false) {
$digits = $format ? $this->getDigitCount($format) : false;
if ($check && !is_callable($check))
$check = false;
do {
$next = $this->__next($digits);
$formatted = $format ? $this->format($format, $next) : $next;
}
while ($check && !$check($formatted, $next));
while ($check
&& !call_user_func_array($check, array($formatted, $next)));
return $formatted;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment