Simplify htmlescape

This commit is contained in:
Dennis Eichhorn 2017-09-14 20:39:58 +02:00
parent 9fc5055b0d
commit 318400358f
3 changed files with 18 additions and 18 deletions

View File

@ -28,12 +28,12 @@ echo $this->getData('nav')->render(); ?>
<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><input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>"><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->getHtml('Create', 0, 0); ?>"><input type="hidden" name="type" value="<?= htmlspecialchars(\Modules\Tasks\Models\TaskType::SINGLE, ENT_COMPAT, 'utf-8'); ?>">
<tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Create', 0, 0); ?>"><input type="hidden" name="type" value="<?= $this->printHtml(\Modules\Tasks\Models\TaskType::SINGLE); ?>">
</table>
</form>
</div>

View File

@ -38,11 +38,11 @@ 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 <?= 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>
<td><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $workflow->getStatus()) ?></span></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getDue()->format('Y-m-d H:i')); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getTitle()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getCreatedBy()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getCreatedAt()->format('Y-m-d H:i')); ?></a>
<?php endforeach; if($c == 0) : ?>
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>

View File

@ -22,15 +22,15 @@ $cElements = count($elements);
echo $this->getData('nav')->render(); ?>
<section class="box w-50">
<header><h1><?= htmlspecialchars($task->getTitle(), ENT_COMPAT, 'utf-8'); ?></h1></header>
<header><h1><?= $this->printHtml($task->getTitle()); ?></h1></header>
<div class="inner">
<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>
<div class="floatRight">Due <?= $this->printHtml($task->getDue()->format('Y-m-d H:i')); ?></div>
<div>Created <?= $this->printHtml($task->getCreatedAt()->format('Y-m-d H:i')); ?></div>
<blockquote>
<?= htmlspecialchars($task->getDescription(), ENT_COMPAT, 'utf-8'); ?>
<?= $this->printHtml($task->getDescription()); ?>
</blockquote>
<div>Created <?= htmlspecialchars($task->getCreatedBy(), ENT_COMPAT, 'utf-8'); ?></div>
<div>Status <?= htmlspecialchars($task->getStatus(), ENT_COMPAT, 'utf-8'); ?></div>
<div>Created <?= $this->printHtml($task->getCreatedBy()); ?></div>
<div>Status <?= $this->printHtml($task->getStatus()); ?></div>
</div>
</section>
@ -42,14 +42,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 <?= 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>
<div class="floatRight"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $element->getStatus()) ?></span></div>
<div><?= $this->printHtml($element->getCreatedBy()); ?> - <?= $this->printHtml($element->getCreatedAt()->format('Y-m-d H:i')); ?></div>
</section>
<?php if ($element->getDescription() !== '') : ?>
<section class="box w-50">
<div class="inner">
<blockquote>
<?= htmlspecialchars($element->getDescription(), ENT_COMPAT, 'utf-8'); ?>
<?= $this->printHtml($element->getDescription()); ?>
</blockquote>
</div>
</section>
@ -59,10 +59,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 <?= htmlspecialchars($element->getDue()->format('Y-m-d H:i'), ENT_COMPAT, 'utf-8'); ?></div>
<div class="floatRight">Due <?= $this->printHtml($element->getDue()->format('Y-m-d H:i')); ?></div>
<?php endif; ?>
<?php if ($element->getForwarded() !== 0) : ?>
<div>Forwarded <?= htmlspecialchars($element->getForwarded(), ENT_COMPAT, 'utf-8'); ?></div>
<div>Forwarded <?= $this->printHtml($element->getForwarded()); ?></div>
<?php endif; ?>
</section>
<?php endforeach; ?>