From 6f981738bb5285d01e839ff640c163acf1b2a184 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vitty@altlinux.ru>
Date: Thu, 10 May 2012 09:10:53 +0000
Subject: Fix some non-utf8-friendly htmlentities (resulting in wrong display
 of utf8-encoded directory names for example)

---
 apps/files/templates/index.php           | 2 +-
 apps/files/templates/part.breadcrumb.php | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'apps/files')

diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 72e45d53275..f8c1b1bdf51 100755
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -15,7 +15,7 @@
 				<form data-upload-id='1' class="file_upload_form" action="<?php echo OCP\Util::linkTo('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1">
 					<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
 					<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
-					<input type="hidden" name="dir" value="<?php echo htmlentities($_['dir']) ?>" id="dir">
+					<input type="hidden" name="dir" value="<?php echo htmlentities($_['dir'],ENT_COMPAT | ENT_HTML401,'utf-8') ?>" id="dir">
 					<button class="file_upload_filename">&nbsp;<img class='svg action' alt="Upload" src="<?php echo OCP\image_path("core", "actions/upload.svg"); ?>" /></button>
 					<input class="file_upload_start" type="file" name='files[]'/>
 						<a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo  ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a>
diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php
index 41d2c5c8e76..f45600543b7 100755
--- a/apps/files/templates/part.breadcrumb.php
+++ b/apps/files/templates/part.breadcrumb.php
@@ -1,6 +1,6 @@
 	<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
         $crumb = $_["breadcrumb"][$i]; ?>
 		<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
-    		<a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlentities($crumb["name"]); ?></a>
+    		<a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlentities($crumb["name"],ENT_COMPAT | ENT_HTML401,'utf-8'); ?></a>
 		</div>
-	<?php endfor;?>
\ No newline at end of file
+	<?php endfor;?>
-- 
cgit v1.2.3