Skip to content

Commit

Permalink
Fixing #5554 - Extra '=' Removed from SNMP output
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Nov 6, 2023
1 parent 4b9a91d commit 7f2d45a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Cacti CHANGELOG
-issue#5527: Upgrade from 0.8.8 to 1.2.25 (latest) fails on db upgrade due to missing data source profile id
-issue#5534: When deleting a single Data Source the table data_debug is not purged
-issue#5542: When a form element does not include a 'value' column, provide a more helpful warning message
-issue#5554: Interface description with equal sign (=) in ifAlias does not show Alias

1.2.25
-security#GHSA-77rf-774j-6h3p: Protect against Insecure deserialization of filter data
Expand Down
6 changes: 2 additions & 4 deletions lib/snmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ function format_snmp_string($string, $snmp_oid_included, $value_output_format =

if ($snmp_oid_included) {
/* strip off all leading junk (the oid and stuff) */
$string_array = explode('=', $string);
$string_array = explode('=', $string, 1);

if (cacti_sizeof($string_array) == 1) {
/* trim excess first */
Expand Down Expand Up @@ -850,7 +850,6 @@ function format_snmp_string($string, $snmp_oid_included, $value_output_format =
* and hex-string: from the passed value
*/
$output = '';

$parts = explode(' ', $string);

if (cacti_sizeof($parts) == 4) {
Expand Down Expand Up @@ -898,12 +897,11 @@ function format_snmp_string($string, $snmp_oid_included, $value_output_format =
$possible_ip = false;
}
} elseif (substr(strtolower($string), 0, 4) == 'hex:') {
$output = '';

/* strip off the 'Hex:' */
$string = trim(str_ireplace('hex:', '', $string));

/* normalize some forms */
$output = '';
$string = str_replace(array(' ', '-', '.'), ':', $string);
$parts = explode(':', $string);

Expand Down

0 comments on commit 7f2d45a

Please sign in to comment.