Skip to content

Commit

Permalink
Labels on AREA having a colon breaks the gradient creation with an rr…
Browse files Browse the repository at this point in the history
…dtool error (#4900)

* Added support for showing business hours

* Added feature to limit display of business hours

* Fix issue where labels on AREA having a colon breaks the gradient creation with an rrdtool error

* Fix issue where labels on AREA having a colon breaks the gradient creation with an rrdtool error

* Hard tabs only

Co-authored-by: ThomasUrban@urban-software.de <rJFsmBR9!15UGZB%G7uc>
Co-authored-by: TheWitness <thewitness@cacti.net>
  • Loading branch information
thurban and TheWitness committed Aug 22, 2022
1 parent 5b32470 commit 3ff8d9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Cacti CHANGELOG
-issue#4893: in cacti 1.2.22 real time counter gets stuck and does not count down
-issue#4903: MySQL 8.x regular expressions break Cacti Automation
-issue#4904: The Recommendation for innodb_buffer_pool_instances is incorrect for MySQL 8 and MariaDB < 10.5
-issue#4905: Labels on AREA having a colon breaks the gradient creation with an rrdtool error
-feature#3131: Button to reindex bad indexes
-feature#4841: Move the cactid function db_check_reconnect() to lib/database.php for other service oriented scripts
-feature#4874: Add support for showing business hours
Expand Down
5 changes: 3 additions & 2 deletions lib/rrd.php
Original file line number Diff line number Diff line change
Expand Up @@ -3809,7 +3809,8 @@ function rrdtool_create_error_image($string, $width = '', $height = '') {
*/
function gradient($vname=FALSE, $start_color='#0000a0', $end_color='#f0f0f0', $label=FALSE, $steps=20, $lower=FALSE, $alpha='FF'){
$label = preg_replace("/'/", "", $label);

$label = preg_replace("/:/", "\:", $label);

if (preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i',$start_color,$matches)) {
$r1=hexdec($matches[1]);
$g1=hexdec($matches[2]);
Expand Down Expand Up @@ -3989,4 +3990,4 @@ function add_business_hours($data) {
}
}
return $data;
}
}

0 comments on commit 3ff8d9b

Please sign in to comment.