Simplify htmlescape

This commit is contained in:
Dennis Eichhorn 2017-09-14 20:39:58 +02:00
parent 8824515abb
commit d8b63b5105
2 changed files with 11 additions and 11 deletions

View File

@ -38,9 +38,9 @@ echo $this->getData('nav')->render(); ?>
<?php $count = 0; foreach($events as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/eventmanagement/profile?{?}&id=' . $value->getId());?>
<tr>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getStart()->format('Y-m-d'), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getEnd()->format('Y-m-d'), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getStart()->format('Y-m-d')); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getEnd()->format('Y-m-d')); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>

View File

@ -20,19 +20,19 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= htmlspecialchars($event->getName(), ENT_COMPAT, 'utf-8'); ?></h1></header>
<header><h1><?= $this->printHtml($event->getName()); ?></h1></header>
<div class="inner">
<form id="fEvent" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/api/eventmanagement?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100">
<tbody>
<tr><td colspan="2"><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td colspan="2"><input type="text" id="iName" name="name" placeholder="&#xf007; Name" value="<?= htmlspecialchars($event->getName(), ENT_COMPAT, 'utf-8'); ?>" required>
<tr><td colspan="2"><input type="text" id="iName" name="name" placeholder="&#xf007; Name" value="<?= $this->printHtml($event->getName()); ?>" required>
<tr><td><label for="iStart"><?= $this->getHtml('Start') ?></label>
<td><label for="iEnd"><?= $this->getHtml('End') ?></label>
<tr><td><input type="datetime-local" id="iStart" name="start" value="<?= htmlspecialchars($event->getStart()->format('Y-m-d\TH:i:s'), ENT_COMPAT, 'utf-8'); ?>">
<td><input type="datetime-local" id="iEnd" name="end" value="<?= htmlspecialchars($event->getEnd()->format('Y-m-d\TH:i:s'), ENT_COMPAT, 'utf-8'); ?>">
<tr><td><input type="datetime-local" id="iStart" name="start" value="<?= $this->printHtml($event->getStart()->format('Y-m-d\TH:i:s')); ?>">
<td><input type="datetime-local" id="iEnd" name="end" value="<?= $this->printHtml($event->getEnd()->format('Y-m-d\TH:i:s')); ?>">
<tr><td colspan="2"><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td colspan="2"><textarea id="iDescription" name="desc"><?= htmlspecialchars($event->getDescription(), ENT_COMPAT, 'utf-8'); ?></textarea>
<tr><td colspan="2"><textarea id="iDescription" name="desc"><?= $this->printHtml($event->getDescription()); ?></textarea>
<tr><td><label for="iBudget"><?= $this->getHtml('Budget') ?></label><td><label for="iActual"><?= $this->getHtml('Actual') ?></label>
<tr><td><input type="text" id="iBudget" name="budget" placeholder=""><td><input type="text" id="iActual" name="actual">
<tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Save', 0, 0); ?>">
@ -61,9 +61,9 @@ echo $this->getData('nav')->render(); ?>
elseif($task->getStatus() === \Modules\Tasks\Models\TaskStatus::CANCELED) { $color = 'red'; }
elseif($task->getStatus() === \Modules\Tasks\Models\TaskStatus::SUSPENDED) { $color = 'yellow'; } ;?>
<tr>
<td><a href="<?= $url; ?>"><span class="tag <?= htmlspecialchars($color, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('S' . $task->getStatus(), 'Tasks') ?></span></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($task->getDue()->format('Y-m-d H:i'), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($task->getTitle(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $task->getStatus(), 'Tasks') ?></span></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($task->getDue()->format('Y-m-d H:i')); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($task->getTitle()); ?></a>
<?php endforeach; if($c == 0) : ?>
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>