Changeset 804
- Timestamp:
- 11/07/06 12:37:04 (2 years ago)
- Files:
-
- trunk/wp-admin/admin-functions.php (modified) (13 diffs)
- trunk/wp-admin/comment.php (modified) (9 diffs)
- trunk/wp-admin/edit-comments.php (modified) (2 diffs)
- trunk/wp-admin/edit-form-comment.php (modified) (2 diffs)
- trunk/wp-admin/edit-page-form.php (modified) (1 diff)
- trunk/wp-admin/edit.php (modified) (2 diffs)
- trunk/wp-admin/import/wordpress.php (modified) (3 diffs)
- trunk/wp-admin/install-rtl.css (modified) (1 diff)
- trunk/wp-admin/link-add.php (modified) (2 diffs)
- trunk/wp-admin/menu-header.php (modified) (2 diffs)
- trunk/wp-admin/moderation.php (modified) (1 diff)
- trunk/wp-admin/options.php (modified) (5 diffs)
- trunk/wp-admin/post-new.php (modified) (1 diff)
- trunk/wp-admin/profile-update.php (modified) (1 diff)
- trunk/wp-admin/profile.php (modified) (3 diffs)
- trunk/wp-admin/rtl.css (modified) (9 diffs)
- trunk/wp-admin/upload-js.php (modified) (1 diff)
- trunk/wp-admin/upload-rtl.css (modified) (2 diffs)
- trunk/wp-admin/upload.css (modified) (1 diff)
- trunk/wp-admin/user-edit.php (modified) (1 diff)
- trunk/wp-admin/wp-admin.css (modified) (3 diffs)
- trunk/wp-includes/class-simplepie.php (added)
- trunk/wp-includes/comment.php (modified) (1 diff)
- trunk/wp-includes/feed.php (modified) (6 diffs)
- trunk/wp-includes/formatting.php (modified) (3 diffs)
- trunk/wp-includes/functions.php (modified) (10 diffs)
- trunk/wp-includes/general-template.php (modified) (2 diffs)
- trunk/wp-includes/js/autosave.js.php (modified) (2 diffs)
- trunk/wp-includes/js/list-manipulation-js.php (modified) (1 diff)
- trunk/wp-includes/link-template.php (modified) (1 diff)
- trunk/wp-includes/pluggable.php (modified) (6 diffs)
- trunk/wp-includes/plugin.php (modified) (9 diffs)
- trunk/wp-includes/post.php (modified) (7 diffs)
- trunk/wp-includes/query.php (modified) (3 diffs)
- trunk/wp-includes/user.php (modified) (1 diff)
- trunk/wp-includes/wpmu-functions.php (modified) (3 diffs)
- trunk/wp-login.php (modified) (3 diffs)
- trunk/wp-settings.php (modified) (1 diff)
- trunk/xmlrpc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/admin-functions.php
r803 r804 123 123 124 124 $i = 0; 125 $search = "# id=(\"|')p(\d+)\\1#i";125 $search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i"; 126 126 foreach ( $anchor_matches[0] as $anchor ) { 127 127 if ( 0 == preg_match($search, $anchor, $id_matches) ) 128 128 continue; 129 129 130 $id = $id_matches[ 2];130 $id = $id_matches[3]; 131 131 132 132 // While we have the attachment ID, let's adopt any orphans. … … 288 288 // Get an existing post and format it for editing. 289 289 function get_post_to_edit($id) { 290 global $richedit;291 $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false;292 290 293 291 $post = get_post($id); 294 292 295 $post->post_content = format_to_edit($post->post_content, $richedit);293 $post->post_content = format_to_edit($post->post_content, user_can_richedit()); 296 294 $post->post_content = apply_filters('content_edit_pre', $post->post_content); 297 295 … … 351 349 352 350 function get_comment_to_edit($id) { 353 global $richedit;354 $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false;355 356 351 $comment = get_comment($id); 357 352 358 $comment->comment_content = format_to_edit($comment->comment_content, $richedit);353 $comment->comment_content = format_to_edit($comment->comment_content, user_can_richedit()); 359 354 $comment->comment_content = apply_filters('comment_edit_pre', $comment->comment_content); 360 355 … … 994 989 if ('_' == $entry['meta_key'] { 0 }) 995 990 $style .= ' hidden'; 991 992 if ( is_serialized($entry['meta_value']) ) { 993 if ( is_serialized_string($entry['meta_value']) ) { 994 // this is a serialized string, so we should display it 995 $entry['meta_value'] = maybe_unserialize($entry['meta_value']); 996 } else { 997 // this is a serialized array/object so we should NOT display it 998 --$count; 999 continue; 1000 } 1001 } 1002 996 1003 $key_js = js_escape($entry['meta_key']); 997 1004 $entry['meta_key'] = wp_specialchars( $entry['meta_key'], true ); … … 1025 1032 function meta_form() { 1026 1033 global $wpdb; 1034 $limit = (int) apply_filters('postmeta_form_limit', 30); 1027 1035 $keys = $wpdb->get_col(" 1028 SELECT meta_key 1029 FROM $wpdb->postmeta 1030 GROUP BY meta_key 1031 ORDER BY meta_id DESC 1032 LIMIT 10"); 1036 SELECT meta_key 1037 FROM $wpdb->postmeta 1038 GROUP BY meta_key 1039 ORDER BY meta_id DESC 1040 LIMIT $limit"); 1041 natcasesort($keys); 1033 1042 ?> 1034 1043 <h3><?php _e('Add a new custom field:') ?></h3> … … 1040 1049 <tr valign="top"> 1041 1050 <td align="right" width="18%"> 1042 <?php if ( $keys) : ?>1051 <?php if ( $keys ) : ?> 1043 1052 <select id="metakeyselect" name="metakeyselect" tabindex="7"> 1044 1053 <option value="#NONE#"><?php _e('- Select -'); ?></option> 1045 1054 <?php 1046 1055 1047 foreach ( $keys as $key) {1056 foreach ( $keys as $key ) { 1048 1057 $key = wp_specialchars($key, 1); 1049 1058 echo "\n\t<option value='$key'>$key</option>"; … … 1069 1078 $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect']))); 1070 1079 $metakeyinput = $wpdb->escape(stripslashes(trim($_POST['metakeyinput']))); 1071 $metavalue = $wpdb->escape(stripslashes(trim($_POST['metavalue']))); 1080 $metavalue = maybe_serialize(stripslashes((trim($_POST['metavalue'])))); 1081 $metavalue = $wpdb->escape($metavalue); 1072 1082 1073 1083 if ( ('0' === $metavalue || !empty ($metavalue)) && ((('#NONE#' != $metakeyselect) && !empty ($metakeyselect)) || !empty ($metakeyinput)) ) { … … 1100 1110 function update_meta($mid, $mkey, $mvalue) { 1101 1111 global $wpdb; 1112 $mvalue = maybe_serialize(stripslashes($mvalue)); 1113 $mvalue = $wpdb->escape($mvalue); 1102 1114 $mid = (int) $mid; 1103 1104 1115 return $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'"); 1105 1116 } … … 1109 1120 $mid = (int) $mid; 1110 1121 1111 return $wpdb->get_row("SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 1122 $meta = $wpdb->get_row("SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 1123 if ( is_serialized_string($meta->meta_value) ) 1124 $meta->meta_value = maybe_unserialize($meta->meta_value); 1125 return $meta; 1112 1126 } 1113 1127 … … 1937 1951 1938 1952 function wp_import_upload_form($action) { 1953 $size = strtolower( ini_get('upload_max_filesize') ); 1954 $bytes = 0; 1955 if ( strstr( $size, 'k' ) ) 1956 $bytes = $size * 1024; 1957 if ( strstr( $size, 'm' ) ) 1958 $bytes = $size * 1024 * 1024; 1959 if ( strstr( $size, 'g' ) ) 1960 $bytes = $size * 1024 * 1024 * 1024; 1939 1961 ?> 1940 1962 <form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo $action ?>"> 1941 1963 <p> 1942 <label for="upload"><?php _e('Choose a file from your computer:'); ?></label> <input type="file" id="upload" name="import" size="25" /> 1964 <label for="upload"><?php _e('Choose a file from your computer:'); ?></label> (<?php printf( __('Maximum size: %s'), $size ); ?>) 1965 <input type="file" id="upload" name="import" size="25" /> 1943 1966 <input type="hidden" name="action" value="save" /> 1967 <input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" /> 1944 1968 </p> 1945 1969 <p class="submit"> … … 1997 2021 <tr> 1998 2022 <th scope="row"><?php $thumb ? _e('Thumbnail linked to file') : _e('Image linked to file'); ?></th> 1999 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td>2023 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>"><?php echo $icon ?></a></textarea></td> 2000 2024 </tr> 2001 2025 <tr> 2002 2026 <th scope="row"><?php $thumb ? _e('Thumbnail linked to page') : _e('Image linked to file'); ?></th> 2003 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment " id="<?php echo $post->ID?>"><?php echo $icon ?></a></textarea></td>2027 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon ?></a></textarea></td> 2004 2028 </tr> 2005 2029 <?php else : ?> … … 2010 2034 <tr> 2011 2035 <th scope="row"><?php _e('Link to page') ?></th> 2012 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment " id="<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td>2036 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment wp-att-<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td> 2013 2037 </tr> 2014 2038 <?php endif; ?> … … 2140 2164 2141 2165 add_action('update_option_new_admin_email', 'update_option_new_admin_email', 10, 2); 2166 2167 function wp_crop_image($src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false) { 2168 if ( ctype_digit($src_file) ) // Handle int as attachment ID 2169 $src_file = get_attached_file($src_file); 2170 2171 $src = wp_load_image($src_file); 2172 2173 if ( !is_resource($src) ) 2174 return $src; 2175 2176 $dst = imagecreatetruecolor($dst_w, $dst_h); 2177 2178 if ( $src_abs ) { 2179 $src_w -= $src_x; 2180 $src_h -= $src_y; 2181 } 2182 2183 imageantialias($dst, true); 2184 imagecopyresampled($dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); 2185 2186 if ( !$dst_file ) 2187 $dst_file = str_replace(basename($src_file), 'cropped-'.basename($src_file), $src_file); 2188 2189 $dst_file = preg_replace('/\\.[^\\.]+$/', '.jpg', $dst_file); 2190 2191 if ( imagejpeg($dst, $dst_file) ) 2192 return $dst_file; 2193 else 2194 return false; 2195 } 2196 2197 function wp_load_image($file) { 2198 if ( ctype_digit($file) ) 2199 $file = get_attached_file($file); 2200 2201 if ( !file_exists($file) ) 2202 return "File '$file' doesn't exist?"; 2203 2204 $contents = file_get_contents($file); 2205 2206 $image = imagecreatefromstring($contents); 2207 2208 if ( !is_resource($image) ) 2209 return "File '$file' is not image?"; 2210 2211 return $image; 2212 } 2213 2142 2214 ?> trunk/wp-admin/comment.php
r797 r804 13 13 case 'editcomment': 14 14 $title = __('Edit Comment'); 15 if ( user_can_richedit() ) 16 wp_enqueue_script( 'wp_tiny_mce' ); 15 17 16 require_once ('admin-header.php'); 18 17 19 $comment = (int) $_GET['c omment'];18 $comment = (int) $_GET['c']; 20 19 21 20 if ( ! $comment = get_comment($comment) ) … … 31 30 break; 32 31 33 case 'c onfirmdeletecomment':34 case 'ma ilapprovecomment':32 case 'cdc': 33 case 'mac': 35 34 36 35 require_once('./admin-header.php'); 37 36 38 $comment = (int) $_GET['comment']; 39 $p = (int) $_GET['p']; 40 $formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment'; 41 $nonce_action = 'confirmdeletecomment' == $action ? 'delete-comment_' : 'approve-comment_'; 37 $comment = (int) $_GET['c']; 38 $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; 39 $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; 42 40 $nonce_action .= $comment; 43 41 … … 46 44 47 45 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 48 wp_die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 49 50 echo "<div class='wrap'>\n"; 51 if ( 'spam' == $_GET['delete_type'] ) 52 echo "<p>" . __('<strong>Caution:</strong> You are about to mark the following comment as spam:') . "</p>\n"; 53 elseif ( 'confirmdeletecomment' == $action ) 54 echo "<p>" . __('<strong>Caution:</strong> You are about to delete the following comment:') . "</p>\n"; 55 else 56 echo "<p>" . __('<strong>Caution:</strong> You are about to approve the following comment:') . "</p>\n"; 57 echo "<table border='0'>\n"; 58 echo "<tr><td>" . __('Author:') . "</td><td>$comment->comment_author</td></tr>\n"; 59 echo "<tr><td>" . __('E-mail:') . "</td><td>$comment->comment_author_email</td></tr>\n"; 60 echo "<tr><td>". __('URL:') . "</td><td>$comment->comment_author_url</td></tr>\n"; 61 echo "<tr><td>". __('Comment:') . "</td><td>$comment->comment_content</td></tr>\n"; 62 echo "</table>\n"; 63 echo "<p>" . __('Are you sure you want to do that?') . "</p>\n"; 64 65 echo "<form action='".get_option('siteurl')."/wp-admin/comment.php' method='get'>\n"; 66 wp_nonce_field($nonce_action); 67 echo "<input type='hidden' name='action' value='$formaction' />\n"; 68 if ( 'spam' == $_GET['delete_type'] ) 69 echo "<input type='hidden' name='delete_type' value='spam' />\n"; 70 echo "<input type='hidden' name='p' value='$p' />\n"; 71 echo "<input type='hidden' name='comment' value='{$comment->comment_ID}' />\n"; 72 echo "<input type='hidden' name='noredir' value='1' />\n"; 73 echo "<input type='submit' value='" . __('Yes') . "' />"; 74 echo " "; 75 echo "<input type='button' value='" . __('No') . "' onclick=\"self.location='". get_option('siteurl') ."/wp-admin/edit-comments.php';\" />\n"; 76 echo "</form>\n"; 77 echo "</div>\n"; 78 46 wp_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 47 ?> 48 <div class='wrap'> 49 50 <div class="narrow"> 51 <?php if ( 'spam' == $_GET['dt'] ) { ?> 52 <p><?php _e('<strong>Caution:</strong> You are about to mark the following comment as spam:'); ?></p> 53 <?php } elseif ( 'cdc' == $action ) { ?> 54 <p><?php _e('<strong>Caution:</strong> You are about to delete the following comment:'); ?></p> 55 <?php } else { ?> 56 <p><?php _e('<strong>Caution:</strong> You are about to approve the following comment:'); ?></p> 57 <?php } ?> 58 59 <p><?php _e('Are you sure you want to do that?'); ?></p> 60 61 <form action='<?php echo get_option('siteurl'); ?>/wp-admin/comment.php' method='get'> 62 63 <table width="100%"> 64 <tr> 65 <td><input type='button' value='<?php _e('No'); ?>' onclick="self.location='<?php echo get_option('siteurl'); ?>/wp-admin/edit-comments.php';" /></td> 66 <td align="right"><input type='submit' value='<?php _e('Yes'); ?>' /></td> 67 </tr> 68 </table> 69 70 <?php wp_nonce_field($nonce_action); ?> 71 <input type='hidden' name='action' value='<?php echo $formaction; ?>' /> 72 <?php if ( 'spam' == $_GET['dt'] ) { ?> 73 <input type='hidden' name='dt' value='spam' /> 74 <?php } ?> 75 <input type='hidden' name='p' value='<?php echo $comment->comment_post_ID; ?>' /> 76 <input type='hidden' name='c' value='<?php echo $comment->comment_ID; ?>' /> 77 <input type='hidden' name='noredir' value='1' /> 78 </form> 79 80 <table class="editform" cellpadding="5"> 81 <tr class="alt"> 82 <th scope="row"><?php _e('Author:'); ?></th> 83 <td><?php echo $comment->comment_author; ?></td> 84 </tr> 85 <?php if ( $comment->comment_author_email ) { ?> 86 <tr> 87 <th scope="row"><?php _e('E-mail:'); ?></th> 88 <td><?php echo $comment->comment_author_email; ?></td> 89 </tr> 90 <?php } ?> 91 <?php if ( $comment->comment_author_url ) { ?> 92 <tr> 93 <th scope="row"><?php _e('URL:'); ?></th> 94 <td><?php echo $comment->comment_author_url; ?></td> 95 </tr> 96 <?php } ?> 97 <tr> 98 <th scope="row" valign="top"><p><?php _e('Comment:'); ?></p></th> 99 <td><?php echo apply_filters( 'comment_text', $comment->comment_content ); ?></td> 100 </tr> 101 </table> 102 103 </div> 104 </div> 105 <?php 79 106 break; 80 107 81 108 case 'deletecomment': 82 $comment = (int) $_REQUEST['c omment'];109 $comment = (int) $_REQUEST['c']; 83 110 check_admin_referer('delete-comment_' . $comment); 84 111 85 $p = (int) $_REQUEST['p'];86 112 if ( isset($_REQUEST['noredir']) ) { 87 113 $noredir = true; … … 90 116 } 91 117 92 $postdata = get_post($p) or93 wp_die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php'));94 95 118 if ( ! $comment = get_comment($comment) ) 96 119 wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php')); … … 99 122 wp_die( __('You are not allowed to edit comments on this post.') ); 100 123 101 if ( 'spam' == $_REQUEST['d elete_type'] )124 if ( 'spam' == $_REQUEST['dt'] ) 102 125 wp_set_comment_status($comment->comment_ID, 'spam'); 103 126 else … … 113 136 114 137 case 'unapprovecomment': 115 $comment = (int) $_GET['c omment'];138 $comment = (int) $_GET['c']; 116 139 check_admin_referer('unapprove-comment_' . $comment); 117 118 $p = (int) $_GET['p']; 140 119 141 if (isset($_GET['noredir'])) { 120 142 $noredir = true; … … 134 156 wp_redirect(wp_get_referer()); 135 157 } else { 136 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$ p.'&c=1#comments');158 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 137 159 } 138 160 exit(); … … 140 162 141 163 case 'approvecomment': 142 $comment = (int) $_GET['c omment'];164 $comment = (int) $_GET['c']; 143 165 check_admin_referer('approve-comment_' . $comment); 144 166 145 $p = (int) $_GET['p'];146 167 if (isset($_GET['noredir'])) { 147 168 $noredir = true; … … 165 186 wp_redirect(wp_get_referer()); 166 187 } else { 167 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$ p.'&c=1#comments');188 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 168 189 } 169 190 exit(); trunk/wp-admin/edit-comments.php
r788 r804 119 119 <?php 120 120 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 121 echo " <a href='comment.php?action=editcomment&c omment=".$comment->comment_ID."'>" . __('Edit') . '</a>';122 echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c omment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';121 echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."'>" . __('Edit') . '</a>'; 122 echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 123 123 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 124 echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c omment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';125 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c omment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';124 echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; 125 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 126 126 } 127 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&d elete_type=spam&p=" . $comment->comment_post_ID . "&comment=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ";127 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=" . $comment->comment_post_ID . "&c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> "; 128 128 } 129 129 $post = get_post($comment->comment_post_ID); … … 184 184 </td> 185 185 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 186 echo "<a href='comment.php?action=editcomment&c omment=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td>186 echo "<a href='comment.php?action=editcomment&c=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td> 187 187 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 188 echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&c omment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape( $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> ";188 echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&c=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape( $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> "; 189 189 } ?></td> 190 190 </tr> trunk/wp-admin/edit-form-comment.php
r797 r804 37 37 </fieldset> 38 38 39 <fieldset id="<?php echo user_can_richedit() ? 'commentdivrich' : 'commentdiv'; ?>"style="clear: both;">39 <fieldset style="clear: both;"> 40 40 <legend><?php _e('Comment') ?></legend> 41 41 <?php the_editor($comment->comment_content, 'content', 'newcomment_author_url'); ?> … … 69 69 <th scope="row" valign="top"><?php _e('Delete'); $delete_nonce = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); ?>:</th> 70 70 <td><input name="deletecomment" class="button delete" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"if ( confirm('" . __("You are about to delete this comment \\n \'Cancel\' to stop, \'OK\' to delete.") . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true; } return false;\""; ?> /> 71 <input type="hidden" name="c omment" value="<?php echo $comment->comment_ID ?>" />71 <input type="hidden" name="c" value="<?php echo $comment->comment_ID ?>" /> 72 72 <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" /> 73 73 <input type="hidden" name="noredir" value="1" /> trunk/wp-admin/edit-page-form.php
r789 r804 1 1 2 2 <div class="wrap"> 3 <h2 id="write-post"><?php _e('Write Page'); ?><?php if ( 0 != $post_ID ) : ?> 4 <small class="quickjump"><a href="#preview-post"><?php _e('preview ↓'); ?></a></small><?php endif; ?></h2> 3 <h2 id="write-post"><?php _e('Write Page'); ?></h2> 5 4 <?php 6 5 if (0 == $post_ID) { trunk/wp-admin/edit.php
r793 r804 283 283 <?php 284 284 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 285 echo " <a href='comment.php?action=editcomment&c omment=".$comment->comment_ID."\'>" . __('Edit') . '</a>';285 echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."\'>" . __('Edit') . '</a>'; 286 286 echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 287 287 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { … … 289 289 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 290 290 } 291 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&d elete_type=spam&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ]";291 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ]"; 292 292 } // end if any comments to show 293 293 ?> trunk/wp-admin/import/wordpress.php
r797 r804 55 55 function checkauthor($author) { 56 56 global $wpdb; 57 //mtnames is an array with the names in the mt import file 58 $pass = 'changeme'; 59 if (!(in_array($author, $this->mtnames))) { //a new mt author name is found 60 ++ $this->j; 61 $this->mtnames[$this->j] = $author; //add that new mt author name to an array 62 $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user 63 if (!$user_id) { //banging my head against the desk now. 64 if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname 65 $user_id = wp_create_user($author, $pass); 66 $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. 67 } else { 68 $user_id = wp_create_user($this->newauthornames[$this->j], $pass); 69 } 70 } else { 71 return $user_id; // return pre-existing wp username if it exists 72 } 73 } else { 74 $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array 75 $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames 76 } 57 58 $map = $_POST['userselect']; 59 60 $user_id = username_exists($map[$author]); //use that key to get the value of the author's name from $newauthornames 77 61 78 62 return $user_id; … … 141 125 <h2><?php _e('Assign Authors'); ?></h2> 142 126 <p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p> 143 <p><?php _e('If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)'); ?></p>144 127 <?php 145 128 … … 152 135 ++ $j; 153 136 echo '<li>Current author: <strong>'.$author.'</strong><br />'.'Map to existing: '; 154 $this->users_form($ author);137 $this->users_form($j); 155 138 echo '</li>'; 156 139 } trunk/wp-admin/install-rtl.css
r784 r804 1 1 body { font-family: Tahoma, Georgia, "Times New Roman", Times, serif; } 2 3 ul, ol { padding: 5px 20px 5px 5px; } 4 5 .step, th { text-align: left; } trunk/wp-admin/link-add.php
r729 r804 18 18 ?> 19 19 20 <?php if ($_GET['added'] ) : ?>20 <?php if ($_GET['added'] && '' != $_POST['link_name']) : ?> 21 21 <div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div> 22 22 <?php endif; ?> … … 27 27 ?> 28 28 29 <div class="wrap"> 30 <?php printf(__('<p>You can drag <a href="%s" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you’re on to your bookmarks! Right now this only works on Mozilla or Netscape, but we’re working on it.</p>'), "javascript:void(linkmanpopup=window.open('" . get_option('siteurl') . "/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?> 29 <div id="wp-link-bookmarklet" class="wrap"> 30 <h3><?php _e('Add Link Bookmarklet'); ?></h3> 31 <p><?php _e('Right click on the following link and choose "Bookmark This Link..." to create an add link shortcut. Right now this only works on Mozilla or Netscape, but we’re working on it.'); ?></p> 32 <?php printf(__('<p><a href="%s" title="Link add bookmarklet">Link This</a></p>'), "javascript:void(linkmanpopup=window.open('" . get_option('siteurl') . "/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?> 31 33 </div> 32 34 trunk/wp-admin/menu-header.php
r793 r804 14 14 if ( !empty($submenu[$item[2]]) || current_user_can($item[1]) ) { 15 15 if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") ) 16 echo "\n\t<li><a href=' " . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";16 echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 17 17 else 18 echo "\n\t<li><a href=' " . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";18 echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>"; 19 19 } 20 20 } … … 43 43 if (file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || ! empty($menu_hook)) { 44 44 if ( 'admin.php' == $pagenow ) 45 echo "\n\t<li><a href=' " . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";45 echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 46 46 else 47 echo "\n\t<li><a href=' " . get_option('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>";47 echo "\n\t<li><a href='{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>"; 48 48 } else { 49 echo "\n\t<li><a href=' " . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";49 echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>"; 50 50 } 51 51 endforeach; trunk/wp-admin/moderation.php
r774 r804 135 135 <?php comment_text() ?> 136 136 <p><?php comment_date('M j, g:i A'); ?> — [ <?php 137 echo '<a href="comment.php?action=editcomment&c omment='.$comment->comment_ID.'">' . __('Edit') . '</a> | ';137 echo '<a href="comment.php?action=editcomment&c='.$comment->comment_ID.'">' . __('Edit') . '</a> | '; 138 138 echo " <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete ') . "</a> | "; ?> 139 139 <?php trunk/wp-admin/options.php
r789 r804 12 12 13 13 if( $_GET[ 'adminhash' ] ) { 14 $new_admin_details = get_option( ' new_admin_email' );14 $new_admin_details = get_option( 'adminhash' ); 15 15 if( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) { 16 16 update_option( "admin_email", $new_admin_details[ 'newemail' ] ); 17 delete_option( "adminhash" ); 17 18 delete_option( "new_admin_email" ); 18 19 } … … 25 26 switch ($option) { 26 27 case 'admin_email': 28 case 'new_admin_email': 27 29 $value = stripslashes($value); 28 30 $value = sanitize_email($value); … … 138 140 <?php 139 141 $options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name"); 140 foreach ( (array) $options as $option )141 $options_to_update[] = $option->option_name;142 $options_to_update = implode(',', $options_to_update);143 ?>144 142 145 <input type="hidden" name="page_options" value="<?php echo $options_to_update; ?>" />146 147 <?php148 143 foreach ( (array) $options as $option) : 149 $value = wp_specialchars($option->option_value, 'single'); 144 $disabled = ''; 145 if ( is_serialized($option->option_value) ) { 146 if ( is_serialized_string($option->option_value) ) { 147 // this is a serialized string, so we should display it 148 $value = wp_specialchars(maybe_unserialize($option->option_value), 'single'); 149 $options_to_update[] = $option->option_name; 150 $class = 'all-options'; 151 } else { 152 $value = 'SERIALIZED DATA'; 153 $disabled = ' disabled="disabled"'; 154 $class = 'all-options disabled'; 155 } 156 } else { 157 $value = wp_specialchars($option->option_value, 'single'); 158 $options_to_update[] = $option->option_name; 159 $class = 'all-options'; 160 } 150 161 echo " 151 162 <tr> … … 153 164 <td>"; 154 165 155 if (stristr($value, "\n")) echo "<textarea class=' all-options' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>$value</textarea>";156 else echo "<input class=' all-options' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "'/>";166 if (stristr($value, "\n")) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>$value</textarea>"; 167 else echo "<input class='$class' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "'$disabled />"; 157 168 158 169 echo "</td> … … 162 173 ?> 163 174 </table> 164 <p class="submit"><input type="submit" name="Update" value="<?php _e('Update Options »') ?>" /></p> 175 <?php $options_to_update = implode(',', $options_to_update); ?> 176 <p class="submit"><input type="hidden" name="page_options" value="<?php echo wp_specialchars($options_to_update, true); ?>" /><input type="submit" name="Update" value="<?php _e('Update Options »') ?>" /></p> 165 177 </form> 166 178 </div> trunk/wp-admin/post-new.php
r789 r804 56 56 <?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?> 57 57 <div id="wp-bookmarklet" class="wrap"> 58 <h3><?php _e('WordPress bookmarklet'); ?></h3>58 <h3><?php _e('WordPress Bookmarklet'); ?></h3> 59 59 <p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p> 60 60 <p> trunk/wp-admin/profile-update.php
r797 r804 18 18 } 19 19 20 if ( !isset( $_POST['rich_editing'] ) ) 21 $_POST['rich_editing'] = 'false'; 22 update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true ); 20 if ( rich_edit_exists() ) { 21 if ( !isset( $_POST['rich_editing'] ) ) 22 $_POST['rich_editing'] = 'false'; 23 update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true ); 24 } 23 25 24 26 if ( isset( $_POST['primary_blog'] ) ) { trunk/wp-admin/profile.php
r793 r804 37 37 38 38 <p class="submit"><input type="submit" value="<?php _e('Update Profile »') ?>" name="submit" /></p> 39 <div style="clear: both"></div> 39 40 40 41 <fieldset> … … 89 90 </label></p> 90 91 91 <p><label><?php _e('Jabber / Google Talk:') ?> 92 <p><label><?php _e('Jabber / Google Talk:') ?><br /> 92 93 <input type="text" name="jabber" value="<?php echo $profileuser->jabber ?>" /></label> 93 94 </p> … … 96 97 <fieldset> 97 98 <legend><?php _e('About Yourself'); ?></legend> 98 <p class="desc"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p>99 <p class="desc"><?php _e('Share a little biographical information. '); ?></p> 99 100 <p><textarea name="description" rows="5" cols="30"><?php echo $profileuser->description ?></textarea></p> 100 101 </fieldset> trunk/wp-admin/rtl.css
r793 r804 1 #viewarc, #viewcat, #namediv, #emaildiv, #uridiv, #planetnews li, #login ul li, #your-profile fieldset, .alignleft .available-theme { 2 float: right 3 } 1 #viewarc, #viewcat, #namediv, #emaildiv, #uridiv, #planetnews li, #login ul li, #your-profile fieldset, 2 #footer .logo, .alignleft .available-theme { float: right; } 4 3 5 #templateside, .alignright { 6 float: left; 7 } 4 #templateside, .alignright { float: left; } 8 5 9 #login, #send, .widefat th { 10 text-align: right 11
