New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected Backtrace with Graph Filters Search for * #604
Comments
We don't allow that character. If you are looking for a wildcard, use the percent, though that would only be between words. |
I'm not sure *router is a valid regex anyway. |
I can't think of a valid regex either. In the past I have run Cacti installations where a filtered view was made visible to end customers - and I wouldn't expect them to know this. I think the best way to handle this would be to print a warning that the * character is not valid in this context and has been ignored, rather than an ugly looking backtrace which looks more like a bug. |
Yea, true. Let me see about that... |
Should be better now. We just clear the filter when the regex is invalid. Right now, there won't be an error message. |
Yep - looks better in the GUI now. This is still logged in cacti.log though: 2017-04-23 22:56:18 - ERROR PHP WARNING: preg_match(): Compilation failed: nothing to repeat at offset 0 in file: /var/www/cacti.reub.net/htdocs/lib/html_utility.php on line: 742 |
Don't show the regex errors when validating.
Should be much better now. |
Looks like something isn't being escaped correctly...
If I go into the Graphs Tab, select a device, and then in Graph Filters so a Search of router (or anything else that starts with an asterisk) I get this output in the browser:
Validation error for variable rfilter, with value of "*router", and error:Compilation failed: nothing to repeat at offset 0. See backtrace below for more details.
(/graph_view.php: 240 html_validate_tree_vars)(/lib/html_tree.php: 533 validate_store_request_vars)(/lib/html_utility.php: 636 die_html_input_error)(/lib/html_validate.php: 60 cacti_debug_backtrace)
The text was updated successfully, but these errors were encountered: