Add html escaping

This commit is contained in:
Dennis Eichhorn 2017-07-24 20:48:22 +02:00
parent addeec0b05
commit 5e23da92e3
3 changed files with 36 additions and 36 deletions

View File

@ -18,28 +18,28 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getText('Event'); ?></h1></header>
<header><h1><?= $this->getHtml('Event') ?></h1></header>
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td colspan="3"><label for="iName"><?= $this->getText('Name'); ?></label>
<tr><td colspan="3"><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td colspan="2"><input type="text" id="iName" name="name" placeholder="" required><td>
<tr><td colspan="3"><label for="iDescription"><?= $this->getText('Description'); ?></label>
<tr><td colspan="3"><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td colspan="2"><textarea id="iDescription" name="description"></textarea><td>
<tr><td colspan="3"><label for="iStatus"><?= $this->getText('Status'); ?></label>
<tr><td colspan="3"><label for="iStatus"><?= $this->getHtml('Status') ?></label>
<tr><td colspan="2"><select id="iStatus" name="status">
<option value="">
</select><td>
<tr><td colspan="3"><label for="iFiles"><?= $this->getText('Files'); ?></label>
<tr><td colspan="3"><label for="iFiles"><?= $this->getHtml('Files') ?></label>
<tr><td colspan="2"><input type="file" id="iFiles" name="file" multiple><td>
<tr><td><label for="iStart"><?= $this->getText('Start') ?><label><td><label for="iEnd"><?= $this->getText('End') ?><label><td>
<tr><td><label for="iStart"><?= $this->getHtml('Start'); ?><label><td><label for="iEnd"><?= $this->getHtml('End'); ?><label><td>
<tr><td><input type="datetime-local" id="iStart" name="start" required><td><input type="datetime-local" id="iEnd" name="end" required><td>
<tr><td><label for="iResponsibility"><?= $this->getText('Responsibility'); ?></label><td><label for="iUser"><?= $this->getText('UserGroup'); ?></label><td>
<tr><td><label for="iResponsibility"><?= $this->getHtml('Responsibility') ?></label><td><label for="iUser"><?= $this->getHtml('UserGroup') ?></label><td>
<tr><td><select id="iStatus" name="status">
<option value="">
</select>
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" id="iUser" name="user" placeholder=""></span><td><button><?= $this->getText('Add', 0, 0); ?></button>
<tr><td colspan="3"><input type="submit" value="<?= $this->getText('Create', 0, 0); ?>">
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" id="iUser" name="user" placeholder=""></span><td><button><?= $this->getHtml('Add', 0, 0); ?></button>
<tr><td colspan="3"><input type="submit" value="<?= $this->getHtml('Create', 0, 0); ?>">
</table>
</form>
</div>

View File

@ -26,25 +26,25 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12">
<div class="box wf-100">
<table class="table red">
<caption><?= $this->getText('Events') ?></caption>
<caption><?= $this->getHtml('Events'); ?></caption>
<thead>
<tr>
<td class="wf-100"><?= $this->getText('Title'); ?>
<td><?= $this->getText('Start'); ?>
<td><?= $this->getText('End'); ?>
<td class="wf-100"><?= $this->getHtml('Title') ?>
<td><?= $this->getHtml('Start') ?>
<td><?= $this->getHtml('End') ?>
<tfoot>
<tr>
<td colspan="5"><?= $footerView->render(); ?>
<td colspan="5"><?= htmlspecialchars($footerView->render(), ENT_COMPAT, 'utf-8'); ?>
<tbody>
<?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; ?>"><?= $value->getName(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getStart()->format('Y-m-d'); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getEnd()->format('Y-m-d'); ?></a>
<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>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

View File

@ -21,20 +21,20 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $event->getName(); ?></h1></header>
<header><h1><?= htmlspecialchars($event->getName(), ENT_COMPAT, 'utf-8'); ?></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->getText('Name'); ?></label>
<tr><td colspan="2"><input type="text" id="iName" name="name" placeholder="&#xf007; Name" value="<?= $event->getName(); ?>" required>
<tr><td><label for="iStart"><?= $this->getText('Start'); ?></label>
<td><label for="iEnd"><?= $this->getText('End'); ?></label>
<tr><td><input type="datetime-local" id="iStart" name="start" value="<?= $event->getStart()->format('Y-m-d\TH:i:s'); ?>">
<td><input type="datetime-local" id="iEnd" name="end" value="<?= $event->getEnd()->format('Y-m-d\TH:i:s'); ?>">
<tr><td colspan="2"><label for="iDescription"><?= $this->getText('Description'); ?></label>
<tr><td colspan="2"><textarea id="iDescription" name="desc"><?= $event->getDescription(); ?></textarea>
<tr><td colspan="2"><input type="submit" value="<?= $this->getText('Save', 0, 0); ?>">
<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><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 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"><input type="submit" value="<?= $this->getHtml('Save', 0, 0); ?>">
</table>
</form>
</div>
@ -44,11 +44,11 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12 col-md-6">
<div class="box wf-100">
<table class="table red">
<caption><?= $this->getText('Tasks', 'Tasks'); ?></caption>
<caption><?= $this->getHtml('Tasks', 'Tasks') ?></caption>
<thead>
<td><?= $this->getText('Status'); ?>
<td><?= $this->getText('Due', 'Tasks'); ?>
<td class="full"><?= $this->getText('Title'); ?>
<td><?= $this->getHtml('Status') ?>
<td><?= $this->getHtml('Due', 'Tasks') ?>
<td class="full"><?= $this->getHtml('Title') ?>
<tfoot>
<tbody>
<?php $c = 0; foreach($tasks as $key => $task) : $c++;
@ -60,11 +60,11 @@ 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 <?= $color; ?>"><?= $this->getText('S' . $task->getStatus(), 'Tasks'); ?></span></a>
<td><a href="<?= $url; ?>"><?= $task->getDue()->format('Y-m-d H:i'); ?></a>
<td><a href="<?= $url; ?>"><?= $task->getTitle(); ?></a>
<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>
<?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>