From 0bba3c691326763ce3d49783e94810aa47385210 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 24 Jul 2017 20:48:22 +0200 Subject: [PATCH] Add html escaping --- Theme/Backend/media-create.tpl.php | 10 +++++----- Theme/Backend/media-list.tpl.php | 28 ++++++++++++++-------------- Theme/Backend/media-single.tpl.php | 14 +++++++------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Theme/Backend/media-create.tpl.php b/Theme/Backend/media-create.tpl.php index 41f0fd1..1e27ef6 100644 --- a/Theme/Backend/media-create.tpl.php +++ b/Theme/Backend/media-create.tpl.php @@ -20,17 +20,17 @@ echo $this->getData('nav')->render(); ?>
-

getText('Upload'); ?>

+

getHtml('Upload') ?>

-
+
-
+
-
+
-
+
diff --git a/Theme/Backend/media-list.tpl.php b/Theme/Backend/media-list.tpl.php index 4864860..312919a 100644 --- a/Theme/Backend/media-list.tpl.php +++ b/Theme/Backend/media-list.tpl.php @@ -28,18 +28,18 @@ echo $this->getData('nav')->render(); ?>
- + - $value) : $count++; $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $value->getId()); @@ -72,15 +72,15 @@ echo $this->getData('nav')->render(); ?> } ?> -
getText('Media'); ?>getHtml('Media') ?>
- getText('Name'); ?> - getText('Type'); ?> - getText('Size'); ?> - getText('Creator'); ?> - getText('Created'); ?> + getHtml('Name') ?> + getHtml('Type') ?> + getHtml('Size') ?> + getHtml('Creator') ?> + getHtml('Created') ?>
render(); ?> + render(), ENT_COMPAT, 'utf-8'); ?>
- getName(); ?> - getExtension(); ?> - getSize(); ?> - getCreatedBy(); ?> - getCreatedAt()->format('Y-m-d H:i:s'); ?> + + getName(), ENT_COMPAT, 'utf-8'); ?> + getExtension(), ENT_COMPAT, 'utf-8'); ?> + getSize(), ENT_COMPAT, 'utf-8'); ?> + getCreatedBy(), ENT_COMPAT, 'utf-8'); ?> + getCreatedAt()->format('Y-m-d H:i:s'), ENT_COMPAT, 'utf-8'); ?> -
getText('Empty', 0, 0); ?> +
getHtml('Empty', 0, 0); ?>
diff --git a/Theme/Backend/media-single.tpl.php b/Theme/Backend/media-single.tpl.php index 18c37d0..104e420 100644 --- a/Theme/Backend/media-single.tpl.php +++ b/Theme/Backend/media-single.tpl.php @@ -25,18 +25,18 @@ echo $this->getData('nav')->render();
-

getName() ?>

+

getName() , ENT_COMPAT, 'utf-8'); ?>

-
SizegetSize(); ?> -
Created atgetCreatedAt()->format('Y-m-d'); ?> -
Created bygetCreatedBy(); ?> -
DescriptiongetDescription(); ?> +
SizegetSize(), ENT_COMPAT, 'utf-8'); ?> +
Created atgetCreatedAt()->format('Y-m-d'), ENT_COMPAT, 'utf-8'); ?> +
Created bygetCreatedBy(), ENT_COMPAT, 'utf-8'); ?> +
DescriptiongetDescription(), ENT_COMPAT, 'utf-8'); ?>
Content
getExtension()) === \phpOMS\System\File\ExtensionType::IMAGE) : ?> -
+
getExtension() === 'collection') : ?> collection @@ -45,7 +45,7 @@ echo $this->getData('nav')->render(); $output = htmlspecialchars(file_get_contents(__DIR__ . '/../../../../' . $media->getPath())); $output = str_replace(["\r\n", "\r"], "\n", $output); $output = explode("\n", $output); - foreach($output as $line) : ?> + foreach($output as $line) : ?>