Simplify htmlescape

This commit is contained in:
Dennis Eichhorn 2017-09-14 20:39:58 +02:00
parent ecee219931
commit f417fcad82
3 changed files with 23 additions and 23 deletions

View File

@ -10,25 +10,25 @@
]
}
]' formaction=""><i class="fa fa-book"></i></button>
<input type="text" list="<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>-datalist" id="<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>" name="receiver" placeholder="&#xf007; Guest" data-action='[
<input type="text" list="<?= $this->printHtml($this->getId()); ?>-datalist" id="<?= $this->printHtml($this->getId()); ?>" name="receiver" placeholder="&#xf007; Guest" data-action='[
{
"key": 1, "listener": "keyup", "action": [
{"key": 1, "type": "validate.keypress", "pressed": "!13"},
{"key": 2, "type": "utils.timer", "id": "<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>", "delay": 500, "resets": true},
{"key": 3, "type": "dom.datalist.clear", "id": "<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>-datalist"},
{"key": 4, "type": "message.request", "uri": "{/base}/{/lang}/api/admin/find/account?search={#<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>}", "method": "GET", "request_type": "json"},
{"key": 5, "type": "dom.datalist.append", "id": "<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>-datalist", "value": "id", "text": "name"}
{"key": 2, "type": "utils.timer", "id": "<?= $this->printHtml($this->getId()); ?>", "delay": 500, "resets": true},
{"key": 3, "type": "dom.datalist.clear", "id": "<?= $this->printHtml($this->getId()); ?>-datalist"},
{"key": 4, "type": "message.request", "uri": "{/base}/{/lang}/api/admin/find/account?search={#<?= $this->printHtml($this->getId()); ?>}", "method": "GET", "request_type": "json"},
{"key": 5, "type": "dom.datalist.append", "id": "<?= $this->printHtml($this->getId()); ?>-datalist", "value": "id", "text": "name"}
]
},
{
"key": 2, "listener": "keydown", "action" : [
{"key": 1, "type": "validate.keypress", "pressed": "13"},
{"key": 2, "type": "message.request", "uri": "{/base}/{/lang}/api/admin/find/account?search={#<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>}", "method": "GET", "request_type": "json"},
{"key": 3, "type": "dom.setvalue", "overwrite": false, "id": "<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>-idlist", "data-path": "", "data": ""},
{"key": 4, "type": "dom.setvalue", "overwrite": false, "id": "<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>-taglist", "data-path": "", "data": ""}
{"key": 2, "type": "message.request", "uri": "{/base}/{/lang}/api/admin/find/account?search={#<?= $this->printHtml($this->getId()); ?>}", "method": "GET", "request_type": "json"},
{"key": 3, "type": "dom.setvalue", "overwrite": false, "id": "<?= $this->printHtml($this->getId()); ?>-idlist", "data-path": "", "data": ""},
{"key": 4, "type": "dom.setvalue", "overwrite": false, "id": "<?= $this->printHtml($this->getId()); ?>-taglist", "data-path": "", "data": ""}
]
}
]' required>
<datalist id="<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>-datalist"></datalist>
<input type="hidden" id="<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>-idlist"></span>
<div id="<?= htmlspecialchars($this->getId(), ENT_COMPAT, 'utf-8'); ?>-taglist"></div>
<datalist id="<?= $this->printHtml($this->getId()); ?>-datalist"></datalist>
<input type="hidden" id="<?= $this->printHtml($this->getId()); ?>-idlist"></span>
<div id="<?= $this->printHtml($this->getId()); ?>-taglist"></div>

View File

@ -40,9 +40,9 @@ $accounts = $this->getData('accounts');
<?php $count = 0; foreach($accounts as $key => $account) : $count++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/profile/single?{?}&id=' . $account->getAccount()->getId()); ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= htmlspecialchars($account->getAccount()->getId(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($account->getAccount()->getName3() . ' ' . $account->getAccount()->getName2() . ' ' . $account->getAccount()->getName1(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($account->getAccount()->getLastActive()->format('Y-m-d'), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getName3() . ' ' . $account->getAccount()->getName2() . ' ' . $account->getAccount()->getName1()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getLastActive()->format('Y-m-d')); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>

View File

@ -35,7 +35,7 @@ echo $this->getData('nav')->render();
<table class="list">
<tr>
<th><?= $this->getHtml('Name') ?><img class="m-profile" alt="<?= $this->getHtml('ProfileImage'); ?>" src="<?= $account->getImage() instanceof \Modules\Media\Models\NullMedia ? \phpOMS\Uri\UriFactory::build('{/base}/Web/Backend/img/user_default_' . mt_rand(1, 6) .'.png') : $account->getImage()->getPath(); ?>">
<td><span itemprop="familyName"><?= htmlspecialchars($account->getAccount()->getName3(), ENT_COMPAT, 'utf-8'); ?></span>, <span itemprop="givenName"><?= htmlspecialchars($account->getAccount()->getName1(), ENT_COMPAT, 'utf-8'); ?></span>
<td><span itemprop="familyName"><?= $this->printHtml($account->getAccount()->getName3()); ?></span>, <span itemprop="givenName"><?= $this->printHtml($account->getAccount()->getName1()); ?></span>
<tr>
<th><?= $this->getHtml('Occupation') ?>
<td itemprop="jobTitle">Sailor
@ -47,7 +47,7 @@ echo $this->getData('nav')->render();
<td itemprop="memberOf">Gosling
<tr>
<th><?= $this->getHtml('Email') ?>
<td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= htmlspecialchars($account->getAccount()->getEmail(), ENT_COMPAT, 'utf-8'); ?></a>
<td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $this->printHtml($account->getAccount()->getEmail()); ?></a>
<tr>
<th>Address
<td>
@ -71,13 +71,13 @@ echo $this->getData('nav')->render();
<td itemprop="telephone">+01 12345-4567
<tr>
<th><?= $this->getHtml('Registered') ?>
<td><?= htmlspecialchars($account->getAccount()->getCreatedAt()->format('Y-m-d'), ENT_COMPAT, 'utf-8'); ?>
<td><?= $this->printHtml($account->getAccount()->getCreatedAt()->format('Y-m-d')); ?>
<tr>
<th><?= $this->getHtml('LastLogin') ?>
<td><?= htmlspecialchars($account->getAccount()->getLastActive()->format('Y-m-d'), ENT_COMPAT, 'utf-8'); ?>
<td><?= $this->printHtml($account->getAccount()->getLastActive()->format('Y-m-d')); ?>
<tr>
<th><?= $this->getHtml('Status') ?>
<td><span class="tag green"><?= htmlspecialchars($account->getAccount()->getStatus(), ENT_COMPAT, 'utf-8'); ?></span>
<td><span class="tag green"><?= $this->printHtml($account->getAccount()->getStatus()); ?></span>
</table>
<!-- @formatter:on -->
</div>
@ -100,10 +100,10 @@ echo $this->getData('nav')->render();
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getId(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getNewestHistory()->getPosition(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getNewestHistory()->getPosition(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getNewestStatus()->getStatus(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getNewestHistory()->getPosition()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getNewestHistory()->getPosition()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getNewestStatus()->getStatus()); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>