Changeset 2662 for trunk/wp-admin/admin-functions.php
- Timestamp:
- 06/26/2005 07:55:12 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/admin-functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r2654 r2662 64 64 $blog_ID = 1; 65 65 66 $post_ID = $_POST['post_ID'];66 $post_ID = (int) $_POST['post_ID']; 67 67 68 68 if (!user_can_edit_post($user_ID, $post_ID, $blog_ID)) … … 70 70 71 71 // Rename. 72 $_POST['ID'] = $_POST['post_ID'];72 $_POST['ID'] = (int) $_POST['post_ID']; 73 73 $_POST['post_content'] = $_POST['content']; 74 74 $_POST['post_excerpt'] = $_POST['excerpt']; … … 120 120 } 121 121 122 function edit_comment() { 123 global $user_ID; 124 125 $comment_ID = (int) $_POST['comment_ID']; 126 $comment_post_ID = (int) $_POST['comment_post_ID']; 127 128 if (!user_can_edit_post_comments($user_ID, $comment_post_ID)) 129 die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.') ); 130 131 $_POST['comment_author'] = $_POST['newcomment_author']; 132 $_POST['comment_author_email'] = $_POST['newcomment_author_email']; 133 $_POST['comment_author_url'] = $_POST['newcomment_author_url']; 134 $_POST['comment_approved'] = $_POST['comment_status']; 135 $_POST['comment_content'] = $_POST['content']; 136 $_POST['comment_ID'] = (int) $_POST['comment_ID']; 137 138 if (user_can_edit_post_date($user_ID, $post_ID) && (!empty($_POST['edit_date']))) { 139 $aa = $_POST['aa']; 140 $mm = $_POST['mm']; 141 $jj = $_POST['jj']; 142 $hh = $_POST['hh']; 143 $mn = $_POST['mn']; 144 $ss = $_POST['ss']; 145 $jj = ($jj > 31) ? 31 : $jj; 146 $hh = ($hh > 23) ? $hh - 24 : $hh; 147 $mn = ($mn > 59) ? $mn - 60 : $mn; 148 $ss = ($ss > 59) ? $ss - 60 : $ss; 149 $_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss"; 150 } 151 152 wp_update_comment($_POST); 153 } 154 122 155 // Get an existing post and format it for editing. 123 156 function get_post_to_edit($id) { … … 157 190 158 191 return $post; 192 } 193 194 function get_comment_to_edit($id) { 195 $comment = get_comment($id); 196 197 $comment->comment_content = format_to_edit($comment->comment_content); 198 $comment->comment_content = apply_filters('comment_edit_pre', $comment->comment_content); 199 200 $comment->comment_author = format_to_edit($comment->comment_author); 201 $comment->comment_author_email = format_to_edit($comment->comment_author_email); 202 $comment->comment_author_url = format_to_edit($comment->comment_author_url); 203 204 return $comment; 159 205 } 160 206
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)