Posts: clickable source links; "unknown" if empty
This commit is contained in:
parent
35146e9587
commit
d92d49d60d
1 changed files with 6 additions and 2 deletions
|
@ -87,8 +87,12 @@
|
|||
|
||||
<div class="key-value source">
|
||||
<span class="key">Source:</span>
|
||||
<span class="value" title="<?php echo $val = htmlspecialchars($this->context->transport->post->source) ?>">
|
||||
<?php echo $val ?>
|
||||
<span class="value" title="<?php echo $val = htmlspecialchars($this->context->transport->post->source ?: 'unknown') ?>">
|
||||
<?php if (preg_match('/^((https?|ftp):|)\/\//', $val)): ?>
|
||||
<a href="<?php echo $val ?>"><?php echo $val ?></a>
|
||||
<?php else: ?>
|
||||
<?php echo $val ?>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue