Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit ae6ea89

Browse files
author
Jamie Snape
committed
Escape variables in visualize module
1 parent df91359 commit ae6ea89

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

modules/visualize/Notification.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ public function getItemViewLink($params)
4040
if ($this->ModuleComponent->Main->canVisualizeWithSliceView($item)) {
4141
$webroot = Zend_Controller_Front::getInstance()->getBaseUrl();
4242
$html = '<li><a href="'.$webroot.'/'.$this->moduleName.'/paraview/slice?itemId=';
43-
$html .= $item->getKey().'"><img alt="" src="'.$webroot.'/modules/';
43+
$html .= htmlspecialchars($item->getKey(), ENT_QUOTES, 'UTF-8').'"><img alt="" src="'.$webroot.'/modules/';
4444
$html .= $this->moduleName.'/public/images/sliceView.png" /> Slice Visualization</a></li>';
4545

4646
$html .= '<li><a href="'.$webroot.'/'.$this->moduleName.'/paraview/volume?itemId=';
47-
$html .= $item->getKey().'"><img alt="" src="'.$webroot.'/modules/';
47+
$html .= htmlspecialchars($item->getKey(), ENT_QUOTES, 'UTF-8').'"><img alt="" src="'.$webroot.'/modules/';
4848
$html .= $this->moduleName.'/public/images/volume.png" /> Volume Visualization</a></li>';
4949

5050
return $html;
5151
} elseif ($this->ModuleComponent->Main->canVisualizeWithSurfaceView($item)
5252
) {
5353
$webroot = Zend_Controller_Front::getInstance()->getBaseUrl();
5454
$html = '<li><a href="'.$webroot.'/'.$this->moduleName.'/paraview/surface?itemId=';
55-
$html .= $item->getKey().'"><img alt="" src="'.$webroot.'/modules/';
55+
$html .= htmlspecialchars($item->getKey(), ENT_QUOTES, 'UTF-8').'"><img alt="" src="'.$webroot.'/modules/';
5656
$html .= $this->moduleName.'/public/images/pqUnstructuredGrid16.png" /> Surface Visualization</a></li>';
5757

5858
return $html;

modules/visualize/views/image/index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ $this->headScript()->appendFile($this->moduleWebroot.'/public/js/jquery/iviewer/
4343
<div class="wrapper">
4444
<div id="viewer" class="viewer"></div>
4545
</div>
46-
<div id='urlImage' style="display:none;"><?php echo $this->imageUrl ?></div>
46+
<div id='urlImage' style="display:none;"><?php echo $this->escape($this->imageUrl); ?></div>
4747
<?php
4848
echo $this->headScript();

modules/visualize/views/wrapper/index.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ $this->headScript()->appendFile($this->webroot.'/modules/visualize/public/js/wra
4242
<?php
4343
foreach ($this->sameLocation as $item) {
4444
echo "<li>";
45-
echo "<a class='linkedcontentLink' preview='{$item->preview}' element='{$item->getKey(
46-
)}' href='{$this->webroot}/item/{$item->getKey()}'>".$this->slicename(
47-
$item->getName(),
45+
echo "<a class='linkedcontentLink' preview='{$item->preview}' element='{$this->escape($item->getKey(
46+
))}' href='{$this->webroot}/item/{$this->escape($item->getKey())}'>".$this->slicename(
47+
$this->escape($item->getName()),
4848
45
4949
)."</a>";
5050
echo "</li>";

0 commit comments

Comments
 (0)