添加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> <fieldset><legend><?php echo $keytypezh[$type]; ?></legend>
<ul> <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 : ?> <?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 endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>

View File

@ -39,7 +39,7 @@ foreach($this->keys as $cg) :
$i=0; $i=0;
endif; endif;
if ($i==0) echo '<div id="'.$cg->keytype.'"><ul>'; 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; endforeach;
echo '</ul></div>'; echo '</ul></div>';
?> ?>