Skip to content
Snippets Groups Projects
Commit e88459ca authored by alvaro's avatar alvaro
Browse files

Improvind Length filter by including number of vars in object

parent 8974898b
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ class Haanga_Extension_Filter_Length
{
$count = hexec('count', $args[0]);
$strlen = hexec('strlen', $args[0]);
$vars = hexec('count', hexec('get_object_vars', $args[0]));
$guess = hexpr_cond(hexec('is_array', $args[0]), hexec('count', $args[0]),
hexec('strlen', $args[0]));
......@@ -18,8 +19,10 @@ class Haanga_Extension_Filter_Length
return $count;
} else if (is_string($value)) {
return $strlen;
} else if (is_object($value)) {
return $vars;
} else {
return $guess;
return $gess;
}
}
......
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