Add html escaping

This commit is contained in:
Dennis Eichhorn 2017-07-24 20:48:22 +02:00
parent d9d68a389d
commit 4f9622d7b4
3 changed files with 43 additions and 43 deletions

View File

@ -18,38 +18,38 @@
echo $this->getData('nav')->render(); ?>
<section class="box w-50 floatLeft">
<header><h1><?= $this->getText('Task'); ?></h1></header>
<header><h1><?= $this->getHtml('Task') ?></h1></header>
<div class="inner">
<form id="fTask" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/api/task/create'); ?>">
<table class="layout wf-100">
<tbody>
<tr><td colspan="2"><label for="iReceiver"><?= $this->getText('To'); ?></label>
<tr><td><span class="input"><button type="button" data-action='[{"type": "popup", "tpl": "acc-grp-tpl", "aniIn": "fadeIn", "aniOut": "fadeOut", "stay": 5000}]' formaction=""><i class="fa fa-book"></i></button><input type="number" min="1" id="iReceiver" name="receiver" placeholder="&#xf007; Guest" required></span><td><button><?= $this->getText('Add', 0, 0); ?></button>
<tr><td colspan="2"><label for="iObserver"><?= $this->getText('CC'); ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="number" min="1" id="iObserver" name="observer" placeholder="&#xf007; Guest" required></span><td><button><?= $this->getText('Add', 0, 0); ?></button>
<tr><td colspan="2"><label for="iDue"><?= $this->getText('Due'); ?></label>
<tr><td><input type="datetime-local" id="iDue" name="due" value="<?= (new \DateTime('NOW'))->format('Y-m-d\TH:i:s') ?>"><td>
<tr><td colspan="2"><label for="iTitle"><?= $this->getText('Title'); ?></label>
<tr><td><input type="text" id="iTitle" name="title" placeholder="&#xf040; <?= $this->getText('Title'); ?>"><td>
<tr><td colspan="2"><label for="iMessage"><?= $this->getText('Message'); ?></label>
<tr><td colspan="2"><label for="iReceiver"><?= $this->getHtml('To') ?></label>
<tr><td><span class="input"><button type="button" data-action='[{"type": "popup", "tpl": "acc-grp-tpl", "aniIn": "fadeIn", "aniOut": "fadeOut", "stay": 5000}]' formaction=""><i class="fa fa-book"></i></button><input type="number" min="1" id="iReceiver" name="receiver" placeholder="&#xf007; Guest" required></span><td><button><?= $this->getHtml('Add', 0, 0); ?></button>
<tr><td colspan="2"><label for="iObserver"><?= $this->getHtml('CC') ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="number" min="1" id="iObserver" name="observer" placeholder="&#xf007; Guest" required></span><td><button><?= $this->getHtml('Add', 0, 0); ?></button>
<tr><td colspan="2"><label for="iDue"><?= $this->getHtml('Due') ?></label>
<tr><td><input type="datetime-local" id="iDue" name="due" value="<?= htmlspecialchars((new \DateTime('NOW'))->format('Y-m-d\TH:i:s') , ENT_COMPAT, 'utf-8'); ?>"><td>
<tr><td colspan="2"><label for="iTitle"><?= $this->getHtml('Title') ?></label>
<tr><td><input type="text" id="iTitle" name="title" placeholder="&#xf040; <?= $this->getHtml('Title') ?>"><td>
<tr><td colspan="2"><label for="iMessage"><?= $this->getHtml('Message') ?></label>
<tr><td><textarea id="iMessage" name="description" placeholder="&#xf040;"></textarea><td>
<tr><td colspan="2"><input type="submit" value="<?= $this->getText('Create', 0, 0); ?>"><input type="hidden" name="type" value="<?= \Modules\Tasks\Models\TaskType::SINGLE; ?>">
<tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Create', 0, 0); ?>"><input type="hidden" name="type" value="<?= htmlspecialchars(\Modules\Tasks\Models\TaskType::SINGLE, ENT_COMPAT, 'utf-8'); ?>">
</table>
</form>
</div>
</section>
<section class="box w-50 floatLeft">
<header><h1><?= $this->getText('Media'); ?></h1></header>
<header><h1><?= $this->getHtml('Media') ?></h1></header>
<div class="inner">
<form>
<table class="layout wf-100">
<tbody>
<tr><td colspan="2"><label for="iMedia"><?= $this->getText('Media'); ?></label>
<tr><td><input type="text" id="iMedia" placeholder="&#xf15b; File"><td><button><?= $this->getText('Select'); ?></button>
<tr><td colspan="2"><label for="iUpload"><?= $this->getText('Upload'); ?></label>
<tr><td colspan="2"><label for="iMedia"><?= $this->getHtml('Media') ?></label>
<tr><td><input type="text" id="iMedia" placeholder="&#xf15b; File"><td><button><?= $this->getHtml('Select') ?></button>
<tr><td colspan="2"><label for="iUpload"><?= $this->getHtml('Upload') ?></label>
<tr><td><input type="file" id="iUpload" form="fTask"><input form="fTask" type="hidden" name="type"><td>
</table>
</form>

View File

@ -21,13 +21,13 @@ echo $this->getData('nav')->render(); ?>
<div class="box w-100 floatLeft">
<table class="table red">
<caption><?= $this->getText('Workflow'); ?></caption>
<caption><?= $this->getHtml('Workflow') ?></caption>
<thead>
<td><?= $this->getText('Status'); ?>
<td><?= $this->getText('Next'); ?>
<td class="full"><?= $this->getText('Title'); ?>
<td><?= $this->getText('Creator'); ?>
<td><?= $this->getText('Created'); ?>
<td><?= $this->getHtml('Status') ?>
<td><?= $this->getHtml('Next') ?>
<td class="full"><?= $this->getHtml('Title') ?>
<td><?= $this->getHtml('Creator') ?>
<td><?= $this->getHtml('Created') ?>
<tfoot>
<tbody>
<?php $c = 0; foreach($workflows as $key => $workflow) : $c++;
@ -39,13 +39,13 @@ echo $this->getData('nav')->render(); ?>
elseif($workflow->getStatus() === \Modules\Workflow\Models\WorkflowStatus::CANCELED) { $color = 'red'; }
elseif($workflow->getStatus() === \Modules\Workflow\Models\WorkflowStatus::SUSPENDED) { $color = 'yellow'; } ;?>
<tr>
<td><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->getText('S' . $workflow->getStatus()); ?></span></a>
<td><a href="<?= $url; ?>"><?= $workflow->getDue()->format('Y-m-d H:i'); ?></a>
<td><a href="<?= $url; ?>"><?= $workflow->getTitle(); ?></a>
<td><a href="<?= $url; ?>"><?= $workflow->getCreatedBy(); ?></a>
<td><a href="<?= $url; ?>"><?= $workflow->getCreatedAt()->format('Y-m-d H:i'); ?></a>
<td><a href="<?= $url; ?>"><span class="tag <?= htmlspecialchars($color, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('S' . $workflow->getStatus()) ?></span></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($workflow->getDue()->format('Y-m-d H:i'), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($workflow->getTitle(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($workflow->getCreatedBy(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($workflow->getCreatedAt()->format('Y-m-d H:i'), ENT_COMPAT, 'utf-8'); ?></a>
<?php endforeach; if($c == 0) : ?>
<tr><td colspan="6" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

View File

@ -23,15 +23,15 @@ $cElements = count($elements);
echo $this->getData('nav')->render(); ?>
<section class="box w-50">
<header><h1><?= $task->getTitle(); ?></h1></header>
<header><h1><?= htmlspecialchars($task->getTitle(), ENT_COMPAT, 'utf-8'); ?></h1></header>
<div class="inner">
<div class="floatRight">Due <?= $task->getDue()->format('Y-m-d H:i'); ?></div>
<div>Created <?= $task->getCreatedAt()->format('Y-m-d H:i'); ?></div>
<div class="floatRight">Due <?= htmlspecialchars($task->getDue()->format('Y-m-d H:i'), ENT_COMPAT, 'utf-8'); ?></div>
<div>Created <?= htmlspecialchars($task->getCreatedAt()->format('Y-m-d H:i'), ENT_COMPAT, 'utf-8'); ?></div>
<blockquote>
<?= $task->getDescription(); ?>
<?= htmlspecialchars($task->getDescription(), ENT_COMPAT, 'utf-8'); ?>
</blockquote>
<div>Created <?= $task->getCreatedBy(); ?></div>
<div>Status <?= $task->getStatus(); ?></div>
<div>Created <?= htmlspecialchars($task->getCreatedBy(), ENT_COMPAT, 'utf-8'); ?></div>
<div>Status <?= htmlspecialchars($task->getStatus(), ENT_COMPAT, 'utf-8'); ?></div>
</div>
</section>
@ -43,14 +43,14 @@ foreach ($elements as $key => $element) : $c++;
elseif($element->getStatus() === \Modules\Tasks\Models\TaskStatus::CANCELED) { $color = 'red'; }
elseif($element->getStatus() === \Modules\Tasks\Models\TaskStatus::SUSPENDED) { $color = 'yellow'; } ?>
<section class="box w-50">
<div class="floatRight"><span class="tag <?= $color; ?>"><?= $this->getText('S' . $element->getStatus()); ?></span></div>
<div><?= $element->getCreatedBy(); ?> - <?= $element->getCreatedAt()->format('Y-m-d H:i'); ?></div>
<div class="floatRight"><span class="tag <?= htmlspecialchars($color, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('S' . $element->getStatus()) ?></span></div>
<div><?= htmlspecialchars($element->getCreatedBy(), ENT_COMPAT, 'utf-8'); ?> - <?= htmlspecialchars($element->getCreatedAt()->format('Y-m-d H:i'), ENT_COMPAT, 'utf-8'); ?></div>
</section>
<?php if ($element->getDescription() !== '') : ?>
<section class="box w-50">
<div class="inner">
<blockquote>
<?= $element->getDescription(); ?>
<?= htmlspecialchars($element->getDescription(), ENT_COMPAT, 'utf-8'); ?>
</blockquote>
</div>
</section>
@ -60,10 +60,10 @@ foreach ($elements as $key => $element) : $c++;
$element->getStatus() !== \Modules\Tasks\Models\TaskStatus::DONE ||
$element->getStatus() !== \Modules\Tasks\Models\TaskStatus::SUSPENDED || $c != $cElements
) : ?>
<div class="floatRight">Due <?= $element->getDue()->format('Y-m-d H:i'); ?></div>
<div class="floatRight">Due <?= htmlspecialchars($element->getDue()->format('Y-m-d H:i'), ENT_COMPAT, 'utf-8'); ?></div>
<?php endif; ?>
<?php if ($element->getForwarded() !== 0) : ?>
<div>Forwarded <?= $element->getForwarded(); ?></div>
<div>Forwarded <?= htmlspecialchars($element->getForwarded(), ENT_COMPAT, 'utf-8'); ?></div>
<?php endif; ?>
</section>
<?php endforeach; ?>
@ -72,17 +72,17 @@ foreach ($elements as $key => $element) : $c++;
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td><label for="iMessage"><?= $this->getText('Message'); ?></label>
<tr><td><label for="iMessage"><?= $this->getHtml('Message') ?></label>
<tr><td><textarea></textarea>
<tr><td><label for="iDue"><?= $this->getText('Due'); ?></label>
<tr><td><label for="iDue"><?= $this->getHtml('Due') ?></label>
<tr><td><input type="datetime-local">
<tr><td><label for="iReceiver"><?= $this->getText('Status'); ?></label>
<tr><td><label for="iReceiver"><?= $this->getHtml('Status') ?></label>
<tr><td><select>
<option>
</select>
<tr><td><label for="iReceiver"><?= $this->getText('To'); ?></label>
<tr><td><label for="iReceiver"><?= $this->getHtml('To') ?></label>
<tr><td><input type="text" id="iReceiver" placeholder="&#xf007; Guest">
<tr><td><input type="submit" value="<?= $this->getText('Create', 0, 0); ?>"><input type="hidden" name="type" value="1">
<tr><td><input type="submit" value="<?= $this->getHtml('Create', 0, 0); ?>"><input type="hidden" name="type" value="1">
</table>
</form>
</div>