Skip to content

Commit

Permalink
Merge pull request #180 from jimbobmcgee/patch-zoomLinkUrlEncode
Browse files Browse the repository at this point in the history
Service descriptions that contain # characters break drag-to-zoom function
  • Loading branch information
lingej authored Mar 20, 2021
2 parents 674ff6c + 77465d3 commit 2a8e312
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions share/pnp/application/views/graph_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,16 @@
.Kohana::lang('common.service',$value['MACRO']['DISP_SERVICEDESC']) . " "
.Kohana::lang('common.datasource',$value['ds_name']) . " "
."\">\n";
echo "<div start=".$value['TIMERANGE']['start']." end=".$value['TIMERANGE']['end']." style=\"width:".$value['GRAPH_WIDTH']."px; height:".$value['GRAPH_HEIGHT']."px; position:absolute; top:33px\" class=\"graph\" id=\"".$this->url."\" ></div>";
$path = pnp::addToUri( array(

# urlencode the graph id, to prevent # chars in service names being
# treated like a url fragment when zooming
$gid = array();
parse_str(ltrim($this->url, '?'), $gid);
$gid = htmlentities("?host=".urlencode($gid["host"])."&srv=".urlencode($gid["srv"]));

echo "<div start=".$value['TIMERANGE']['start']." end=".$value['TIMERANGE']['end']." style=\"width:".$value['GRAPH_WIDTH']."px; height:".$value['GRAPH_HEIGHT']."px; position:absolute; top:33px\" class=\"graph\" id=\"".$gid."\" ></div>";

$path = pnp::addToUri( array(
'host' => $value['MACRO']['HOSTNAME'],
'srv' => $value['MACRO']['SERVICEDESC'],
'view' => $value['VIEW'],
Expand Down

0 comments on commit 2a8e312

Please sign in to comment.