sanitizeHTML() has to be called later to keep the path unchanged

This commit is contained in:
Bjoern Schiessle 2012-06-25 12:44:54 +02:00
parent a4c47c674d
commit a09a01a49f
2 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@ for($i = 0; $i<count($root_images); $i++) {
} }
$tmpl = new OCP\Template( 'gallery', 'index', 'user' ); $tmpl = new OCP\Template( 'gallery', 'index', 'user' );
$tmpl->assign('root', $root); $tmpl->assign('root', $root, false);
$tmpl->assign('tl', $tl, false); $tmpl->assign('tl', $tl, false);
$tmpl->printPage(); $tmpl->printPage();
?> ?>

View File

@ -1,6 +1,6 @@
<script type="text/javascript"> <script type="text/javascript">
var root = "<?php echo OCP\Util::sanitizeHTML($_['root']); ?>"; var root = "<?php echo $_['root']; ?>";
$(document).ready(function() { $(document).ready(function() {
$("a[rel=images]").fancybox({ $("a[rel=images]").fancybox({
@ -18,7 +18,7 @@ $(document).ready(function() {
for ($i = 0; $i < count($paths); $i++) { for ($i = 0; $i < count($paths); $i++) {
$path .= urlencode($paths[$i]).'/'; $path .= urlencode($paths[$i]).'/';
$classess = 'crumb'.($i == count($paths)-1?' last':''); $classess = 'crumb'.($i == count($paths)-1?' last':'');
echo '<div class="'.$classess.'" style="background-image:url(\''.\OCP\image_path('core','breadcrumb.png').'\')"><a href="'.\OCP\Util::linkTo('gallery', 'index.php').'&root='.$path.'">'.$paths[$i].'</a></div>'; echo '<div class="'.$classess.'" style="background-image:url(\''.\OCP\image_path('core','breadcrumb.png').'\')"><a href="'.\OCP\Util::linkTo('gallery', 'index.php').'&root='.$path.'">'.OCP\Util::sanitizeHTML($paths[$i]).'</a></div>';
} }
} }