Skip to content

Commit

Permalink
Merge pull request #965 from f0o/issue-951
Browse files Browse the repository at this point in the history
Fix logic bugs and strip %%
  • Loading branch information
laf committed May 11, 2015
2 parents cee2ee3 + a8e5880 commit 3d4df79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions html/includes/graphs/common.inc.php
Expand Up @@ -7,9 +7,9 @@
if ($_GET['height']) { $height = mres($_GET['height']); }
if ($_GET['inverse']) { $in = 'out'; $out = 'in'; $inverse=TRUE; } else { $in = 'in'; $out = 'out'; }
if ($_GET['legend'] == "no") { $rrd_options .= " -g"; }
if ($_GET['nototal']) { $nototal=TRUE;} else { $nototal=FALSE;}
if ($_GET['nodetails']) { $nodetails=TRUE; } else { $nodetails=FALSE; }
if ($_GET['noagg']) { $noagg=TRUE; } else { $noagg=FALSE; }
if (empty($_GET['nototal'])) { $nototal=TRUE; } else { $nototal=FALSE; }
if (empty($_GET['nodetails'])) { $nodetails=TRUE; } else { $nodetails=FALSE; }
if (empty($_GET['noagg'])) { $noagg=TRUE; } else { $noagg=FALSE; }

if ($_GET['title'] == "yes") { $rrd_options .= " --title='".$graph_title."' "; }
if (isset($_GET['graph_title'])) { $rrd_options .= " --title='".$_GET['graph_title']."' "; }
Expand Down
1 change: 1 addition & 0 deletions includes/rrdtool.inc.php
Expand Up @@ -257,6 +257,7 @@ function rrdtool_lastupdate($filename, $options)
function rrdtool_escape($string, $maxlength = NULL)
{
$result = shorten_interface_type($string);
$result = str_replace('%','%%',$result);
if ( is_numeric($maxlength) ) {
$extra = substr_count($string,':',0,$maxlength);
$result = substr(str_pad($result, $maxlength),0,$maxlength+$extra);
Expand Down

0 comments on commit 3d4df79

Please sign in to comment.