diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 243ee668f1f01f37281c233923897459300f40e3..e345b91e293c0e2244c8e3a91708b60984e95280 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -168,18 +168,17 @@ if (isset($path)) {
 				}
 			}
 			$list = new OCP\Template('files', 'part.list', '');
-			$list->assign('files', $files, false);
+			$list->assign('files', $files);
 			$list->assign('disableSharing', true);
-			$list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false);
+			$list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=');
 			$list->assign('downloadURL',
-				OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=',
-				false);
+				OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=');
 			$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
-			$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
-			$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false);
+			$breadcrumbNav->assign('breadcrumb', $breadcrumb);
+			$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=');
 			$folder = new OCP\Template('files', 'index', '');
-			$folder->assign('fileList', $list->fetchPage(), false);
-			$folder->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);
+			$folder->assign('fileList', $list->fetchPage());
+			$folder->assign('breadcrumb', $breadcrumbNav->fetchPage());
 			$folder->assign('dir', $getPath);
 			$folder->assign('isCreatable', false);
 			$folder->assign('permissions', 0);
@@ -188,7 +187,7 @@ if (isset($path)) {
 			$folder->assign('uploadMaxHumanFilesize', 0);
 			$folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
 			$folder->assign('usedSpacePercent', 0);
-			$tmpl->assign('folder', $folder->fetchPage(), false);
+			$tmpl->assign('folder', $folder->fetchPage());
 			$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
 			$tmpl->assign('downloadURL',
 				OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath));
diff --git a/apps/files_sharing/templates/authenticate.php b/apps/files_sharing/templates/authenticate.php
index 6bce6857ac8667ed80a197b674a0f0c55ebf4fce..b6ef82da6f09678a9fa972440a9eb608bf6861c3 100644
--- a/apps/files_sharing/templates/authenticate.php
+++ b/apps/files_sharing/templates/authenticate.php
@@ -1,9 +1,9 @@
-<form action="<?php echo $_['URL']; ?>" method="post">
+<form action="<?php p($_['URL']); ?>" method="post">
 	<fieldset>
 		<p class="infield">
-			<label for="password" class="infield"><?php echo $l->t('Password'); ?></label>
+			<label for="password" class="infield"><?php p($l->t('Password')); ?></label>
 			<input type="password" name="password" id="password" value="" autofocus />
-			<input type="submit" value="<?php echo $l->t('Submit'); ?>" />
+			<input type="submit" value="<?php p($l->t('Submit')); ?>" />
 		</p>
 	</fieldset>
 </form>
\ No newline at end of file
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index f9ff12679bcc7772fc0299c7eec1621ea44fef79..88692445ec308d2f45f5c001a92b08bad738b050 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -1,43 +1,43 @@
-<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
-<input type="hidden" name="downloadURL" value="<?php echo $_['downloadURL'] ?>" id="downloadURL">
-<input type="hidden" name="filename" value="<?php echo $_['filename'] ?>" id="filename">
-<input type="hidden" name="mimetype" value="<?php echo $_['mimetype'] ?>" id="mimetype">
+<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
+<input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
+<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
+<input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
 <header><div id="header">
-	<a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg"
-		src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a>
+	<a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg"
+		src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="ownCloud" /></a>
 	<div class="header-right">
 	<?php if (isset($_['folder'])): ?>
-		<span id="details"><?php echo $l->t('%s shared the folder %s with you',
-			array($_['displayName'], $_['fileTarget'])) ?></span>
+		<span id="details"><?php p($l->t('%s shared the folder %s with you',
+			array($_['displayName'], $_['fileTarget']))) ?></span>
 	<?php else: ?>
-		<span id="details"><?php echo $l->t('%s shared the file %s with you',
-			array($_['displayName'], $_['fileTarget'])) ?></span>
+		<span id="details"><?php p($l->t('%s shared the file %s with you',
+			array($_['displayName'], $_['fileTarget']))) ?></span>
 	<?php endif; ?>
 		<?php if (!isset($_['folder']) || $_['allowZipDownload']): ?>
-			<a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img
-				class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>"
-				/><?php echo $l->t('Download')?></a>
+			<a href="<?php p($_['downloadURL']); ?>" class="button" id="download"><img
+				class="svg" alt="Download" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"
+				/><?php p($l->t('Download'))?></a>
 		<?php endif; ?>
 	</div>
 </div></header>
 <div id="preview">
 	<?php if (isset($_['folder'])): ?>
-		<?php echo $_['folder']; ?>
+		<?php print_unescaped($_['folder']); ?>
 	<?php else: ?>
 		<?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'image'): ?>
 			<div id="imgframe">
-				<img src="<?php echo $_['downloadURL']; ?>" />
+				<img src="<?php p($_['downloadURL']); ?>" />
 			</div>
 		<?php endif; ?>
 		<ul id="noPreview">
 			<li class="error">
-				<?php echo $l->t('No preview available for').' '.$_['fileTarget']; ?><br />
-				<a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download"
-					src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>"
-					/><?php echo $l->t('Download')?></a>
+				<?php p($l->t('No preview available for').' '.$_['fileTarget']); ?><br />
+				<a href="<?php p($_['downloadURL']); ?>" id="download"><img class="svg" alt="Download"
+					src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"
+					/><?php p($l->t('Download'))?></a>
 			</li>
 		</ul>
 	<?php endif; ?>
 </div>
 <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash;
-<?php echo $l->t('web services under your control'); ?></p></footer>
+<?php p($l->t('web services under your control')); ?></p></footer>