添加urlencode处理url特殊字符,包括#,'等

This commit is contained in:
wlx 2010-01-07 06:31:20 +00:00
parent 509f3331ee
commit 7d806cacd0
2 changed files with 3 additions and 3 deletions

View File

@ -42,9 +42,9 @@ foreach($this->keywords as $cg) :
?>
<fieldset><legend><?php echo $keytypezh[$type]; ?></legend>
<ul>
<li><a href='/data/tag/<?php echo htmlspecialchars($cg['keyword']); ?>'><?php echo $cg['keyword']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
<li><a href='/data/tag/<?php echo urlencode($cg['keyword']); ?>'><?php echo $cg['keyword']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
<?php else : ?>
<li><a href='/data/tag/<?php echo htmlspecialchars($cg['keyword']); ?>'><?php echo $cg['keyword']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
<li><a href='/data/tag/<?php echo urlencode($cg['keyword']); ?>'><?php echo $cg['keyword']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>

View File

@ -39,7 +39,7 @@ foreach($this->keys as $cg) :
$i=0;
endif;
if ($i==0) echo '<div id="'.$cg->keytype.'"><ul>';
echo '<li><a href="/data/tag/key/'.$cg->keyword.'">'.$cg->keyword.'</a></li>';
echo '<li><a href="/data/tag/key/'.urlencode($cg->keyword).'">'.$cg->keyword.'</a></li>';
endforeach;
echo '</ul></div>';
?>