mirror of
https://github.com/typecho/typecho.git
synced 2025-01-16 20:18:19 +01:00
escape mail string before output
This commit is contained in:
parent
98e4c1d16d
commit
0433a11c0a
@ -131,7 +131,7 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Ty
|
||||
<div class="comment-meta">
|
||||
<strong class="comment-author"><?php $comments->author(true); ?></strong>
|
||||
<?php if($comments->mail): ?>
|
||||
<br /><span><a href="mailto:<?php $comments->mail(); ?>"><?php $comments->mail(); ?></a></span>
|
||||
<br /><span><a href="<?php $comments->mail(true); ?>"><?php $comments->mail(); ?></a></span>
|
||||
<?php endif; ?>
|
||||
<?php if($comments->ip): ?>
|
||||
<br /><span><?php $comments->ip(); ?></span>
|
||||
|
@ -306,6 +306,18 @@ class Comments extends Base implements QueryInterface
|
||||
echo Common::subStr(strip_tags($this->content), 0, $length, $trim);
|
||||
}
|
||||
|
||||
/**
|
||||
* 输出邮箱地址
|
||||
*
|
||||
* @param bool $link
|
||||
* @return void
|
||||
*/
|
||||
public function mail(bool $link = false)
|
||||
{
|
||||
$mail = htmlspecialchars($this->mail);
|
||||
echo $link ? 'mailto:' . $mail : $mail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取查询对象
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user