Comment_allowed_tags fixup.

git-svn-id: http://svn.automattic.com/wordpress/trunk@709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-01-03 23:48:16 +00:00
parent 4ef7999064
commit f4e3970ec1
4 changed files with 20 additions and 6 deletions

View File

@ -53,7 +53,7 @@ if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass_'.$c
<?php if ('open' == $commentstatus->comment_status) { ?>
<h2>Leave a Comment</h2>
<p>Line and paragraph breaks automatic, website trumps email, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo htmlentities(str_replace('<', ' <', $comment_allowed_tags)); ?></code></p>
<p>Line and paragraph breaks automatic, website trumps email, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>
<form action="<?php echo $siteurl; ?>/wp-comments-post.php" method="post" id="commentform">
<p>

View File

@ -44,7 +44,7 @@
<h2>Leave a Comment</h2>
<?php if ('open' == $post->comment_status) { ?>
<p>Line and paragraph breaks automatic, website trumps email, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo htmlentities(str_replace('<', ' <', $comment_allowed_tags)); ?></code></p>
<p>Line and paragraph breaks automatic, website trumps email, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>
<form action="<?php echo $siteurl; ?>/wp-comments-post.php" method="post" id="commentform">
<p>

View File

@ -18,10 +18,10 @@ $allowedtags = array('b' => array(),
'abbr' => array('title'),
'em' => array(),
'strike' => array(),
'a' => array('href' => array('minlen' => 6, 'maxlen' => 250),
'a' => array('href',
'title',
'rel' => array('minlen' => 3, 'maxlen' => 250)),
'blockquote' => array('cite' => array()),
'rel'),
'blockquote' => array('cite'),
'del' => array('datetime'),
'br' => array());

View File

@ -1879,4 +1879,18 @@ function permalink_single_rss($file = '') {
/***** // Permalink tags *****/
?>
function allowed_tags() {
global $allowedtags;
foreach($allowedtags as $tag => $attributes) {
$allowed .= "<$tag";
if (0 < count($attributes)) {
foreach ($attributes as $attribute) {
$allowed .= " $attribute=\"\"";
}
}
$allowed .= "> ";
}
return htmlentities($allowed);
}
?>