Comment redirect fix from mdawaffe. fixes #2764

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@3828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-06-01 21:47:50 +00:00
parent c80bebbcd6
commit 34e0b7b5ea
2 changed files with 5 additions and 4 deletions

View File

@ -322,8 +322,10 @@ case 'approvecomment':
case 'editedcomment':
$comment_id = (int) $_POST['comment_ID'];
check_admin_referer('update-comment_' . $comment_id);
$comment_ID = (int) $_POST['comment_ID'];
$comment_post_ID = (int) $_POST['comment_post_ID'];
check_admin_referer('update-comment_' . $comment_ID);
edit_comment();

View File

@ -243,8 +243,7 @@ function check_admin_referer($action = -1) {
$q = explode( ini_get('arg_separator.output'), $q);
$html .= "\t<form method='post' action='$pagenow'>\n";
foreach ( (array) $q as $a ) {
$v = substr(strstr($a, '='), 1);
$k = substr($a, 0, -(strlen($v)+1));
list($k, $v) = explode('=', $a, 2);
$html .= "\t\t<input type='hidden' name='" . wp_specialchars( urldecode($k), 1 ) . "' value='" . wp_specialchars( urldecode($v), 1 ) . "' />\n";
}
$html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n";