修复 完善XSS漏洞的修复
This commit is contained in:
parent
a90b72af51
commit
4887604d80
|
@ -210,7 +210,7 @@ function dhtmlspecialchars($string, $flags = null) {
|
||||||
if($flags === null) {
|
if($flags === null) {
|
||||||
$string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string);
|
$string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string);
|
||||||
if(strpos($string, '&#') !== false) {
|
if(strpos($string, '&#') !== false) {
|
||||||
$string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string);
|
$string = preg_replace('/&((#(\d{3,5}));)/', '&\\1', $string);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(PHP_VERSION < '5.4.0') {
|
if(PHP_VERSION < '5.4.0') {
|
||||||
|
|
|
@ -31,13 +31,13 @@
|
||||||
<ul class="biduser cl">
|
<ul class="biduser cl">
|
||||||
<li class="bidtop">
|
<li class="bidtop">
|
||||||
<!--{if $memberlist}-->
|
<!--{if $memberlist}-->
|
||||||
<a href="home.php?mod=space&uid=$memberlist[0][uid]&do=profile" target="_blank" id="bid_$memberlist[0][uid]" class="hm" {if $memberlist[0][note]} onmouseover="showTip(this)" tip="$memberlist[0][username]: {echo htmlspecialchars($memberlist[0][note])}"{/if}><!--{avatar($memberlist[0][uid],middle)}--></a>
|
<a href="home.php?mod=space&uid=$memberlist[0][uid]&do=profile" target="_blank" id="bid_$memberlist[0][uid]" class="hm" {if $memberlist[0][note]} onmouseover="showTip(this)" tip="$memberlist[0][username]: $memberlist[0][note]"{/if}><!--{avatar($memberlist[0][uid],middle)}--></a>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</li>
|
</li>
|
||||||
<!--{eval unset($memberlist[0]);}-->
|
<!--{eval unset($memberlist[0]);}-->
|
||||||
<!--{loop $memberlist $member}-->
|
<!--{loop $memberlist $member}-->
|
||||||
<li>
|
<li>
|
||||||
<a href="home.php?mod=space&uid=$member[uid]&do=profile" target="_blank" id="bid_$member[uid]" {if $member[note]} onmouseover="showTip(this)" tip="$member[username]: {echo htmlspecialchars($member[note])}"{/if}>$member[avatar]</a>
|
<a href="home.php?mod=space&uid=$member[uid]&do=profile" target="_blank" id="bid_$member[uid]" {if $member[note]} onmouseover="showTip(this)" tip="$member[username]: $member[note]"{/if}>$member[avatar]</a>
|
||||||
</li>
|
</li>
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue