data_query.php - quick patch

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
brylant
Posts: 36
Joined: Mon Aug 17, 2009 9:05 am

data_query.php - quick patch

Post by brylant »

Changing line 116 in data_query_php from this:

Code: Select all

if (preg_match("/(.*)" . preg_quote($script_queries["output_delimeter"]) . "(.*)/", $script_data_array[$i], $matches)) {
to this:

Code: Select all

if (preg_match("/(.*?)" . preg_quote($script_queries["output_delimeter"]) . "(.*)/", $script_data_array[$i], $matches)) {
matches on first occurence ('non-greedy') and thus allowing "xml_delimeter" to appear in the field itself (useful for eg. interface description that has ! and possibly all other characters)...
Works for me ;-)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

That's not a correct fix.
In case the "delimiter" shows up in the index, your modification won't work. Honestly, the current code does not work in that case, either. But we need a different fix, then
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest