Changeset 804
- Timestamp:
- 11/07/2006 12:37:04 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 38 edited
-
wp-admin/admin-functions.php (modified) (13 diffs)
-
wp-admin/comment.php (modified) (9 diffs)
-
wp-admin/edit-comments.php (modified) (2 diffs)
-
wp-admin/edit-form-comment.php (modified) (2 diffs)
-
wp-admin/edit-page-form.php (modified) (1 diff)
-
wp-admin/edit.php (modified) (2 diffs)
-
wp-admin/import/wordpress.php (modified) (3 diffs)
-
wp-admin/install-rtl.css (modified) (1 diff)
-
wp-admin/link-add.php (modified) (2 diffs)
-
wp-admin/menu-header.php (modified) (2 diffs)
-
wp-admin/moderation.php (modified) (1 diff)
-
wp-admin/options.php (modified) (5 diffs)
-
wp-admin/post-new.php (modified) (1 diff)
-
wp-admin/profile-update.php (modified) (1 diff)
-
wp-admin/profile.php (modified) (3 diffs)
-
wp-admin/rtl.css (modified) (9 diffs)
-
wp-admin/upload-js.php (modified) (1 diff)
-
wp-admin/upload-rtl.css (modified) (2 diffs)
-
wp-admin/upload.css (modified) (1 diff)
-
wp-admin/user-edit.php (modified) (1 diff)
-
wp-admin/wp-admin.css (modified) (3 diffs)
-
wp-includes/class-simplepie.php (added)
-
wp-includes/comment.php (modified) (1 diff)
-
wp-includes/feed.php (modified) (6 diffs)
-
wp-includes/formatting.php (modified) (3 diffs)
-
wp-includes/functions.php (modified) (10 diffs)
-
wp-includes/general-template.php (modified) (2 diffs)
-
wp-includes/js/autosave.js.php (modified) (2 diffs)
-
wp-includes/js/list-manipulation-js.php (modified) (1 diff)
-
wp-includes/link-template.php (modified) (1 diff)
-
wp-includes/pluggable.php (modified) (6 diffs)
-
wp-includes/plugin.php (modified) (9 diffs)
-
wp-includes/post.php (modified) (7 diffs)
-
wp-includes/query.php (modified) (3 diffs)
-
wp-includes/user.php (modified) (1 diff)
-
wp-includes/wpmu-functions.php (modified) (3 diffs)
-
wp-login.php (modified) (3 diffs)
-
wp-settings.php (modified) (1 diff)
-
xmlrpc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
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 } 6 #login #send, .readmore, .widefat th { text-align: right; } 12 7 13 #postcustomsubmit, form#upload th, .submit, .editform th { 14 text-align: left 15 } 8 #postcustomsubmit, form#upload th, .submit, .editform th { text-align: left; } 16 9 17 body, td { 18 font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana; 19 } 10 #devnews h4, #wphead h1, #your-profile legend, fieldset.options legend, 11 #planetnews li .post { font-family: Tahoma, Georgia, "Times New Roman", Times, serif; } 20 12 21 fieldset.options legend { 22 font-family: Tahoma, Georgia, "Times New Roman", Times, serif; 23 } 13 #wphead { padding: .8em 2em .8em 19em; } 24 14 25 textarea, input, select { 26 font: 13px Tahoma, Verdana, Arial, Helvetica, sans-serif; 27 } 15 #wphead h1 { font-size: 2.4em; } 28 16 29 .quicktags, .search { 30 font: 12px Tahoma, Georgia, "Times New Roman", Times, serif; 31 } 17 #postdiv , #titlediv, #guiddiv { margin: 0 0 0 8px; } 32 18 33 .submit input, .submit input:focus, .button { 19 #ed_toolbar input { margin: 3px 0 2px 2px; } 20 21 #edButtons input, #edButtons input:active { margin: 0px 0 -1px 2px; } 22 23 body, td { font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana; } 24 25 h2 { font: normal 32px/5px serif; } 26 27 textarea, input, select { font: 13px Tahoma, Verdana, Arial, Helvetica, sans-serif; } 28 29 .quicktags, .search { font: 12px Tahoma, Georgia, "Times New Roman", Times, serif; } 30 31 .updated, .confirm { padding: 0 3em 0 1em; } 32 33 .submit input, .submit input:focus, .button, .button:focus { 34 border-left-color: #999; 34 35 border-right-color: #ccc; 35 36 } 36 37 37 38 .submit input:active, .button:active { 39 border-left-color: #ccc; 38 40 border-right-color: #999; 39 }40 41 .updated, .confirm {42 padding: 0 3em 0 1em;43 41 } 44 42 … … 54 52 } 55 53 56 # submenu{57 height: 21px;58 padding: 3px 3em 0 2em;54 #adminmenu a.current { 55 border-right: 0; 56 border-left: 2px solid #4f96c8; 59 57 } 60 58 59 #adminmenu li { line-height: 180%; } 60 61 #submenu, #minisub { padding: 3px 3em 0 2em; } 62 61 63 #submenu .current { 64 border-right: 0; 62 65 border-left: 2px solid #045290; 63 66 } 64 67 65 68 #submenu a { 66 padding: .3em .4em . 33em .4em;69 padding: .3em .4em .4em .4em; 67 70 margin: 0 0 0 10px; 68 71 display: block; … … 70 73 } 71 74 72 #submenu li { 73 line-height: 100%; 74 } 75 76 #postdiv , #titlediv, #guiddiv { 77 margin: 0 0 0 8px; 78 } 75 #submenu li { line-height: 120%; } 79 76 80 77 #currenttheme img { … … 85 82 86 83 #postdiv #quicktags { 87 padding-right: auto;84 padding-right: 0; 88 85 padding-left: 6px; 89 86 } 90 87 91 #quicktags #ed_toolbar { 92 padding: 0px 0 0 2px; 93 } 94 95 #ed_toolbar input { 96 margin: 3px 0 2px 2px; 88 .readmore { 89 margin-right: auto; 90 margin-left: 5em; 97 91 } 98 92 99 93 * html #postexcerpt .dbx-toggle-open, * html #postexcerpt .dbx-toggle-open, #postexcerpt div, #attachmentlinks div { 100 padding-right: auto;94 padding-right: 0; 101 95 padding-left: 8px; 102 }103 104 #login h1 {105 left: auto;106 right: 137px;107 }108 109 #login h1 a {110 display: none;111 96 } 112 97 … … 114 99 float: right; 115 100 margin-right: auto; 116 margin-left: 3em;101 margin-left: 1em; 117 102 } 118 103 … … 137 122 } 138 123 139 #wphead {140 padding: .8em 2em .8em 19em;141 }142 143 #wphead h1 {144 font-size: 2.4em;145 font-family: Tahoma, Georgia, "Times New Roman", Times, serif146 }147 148 124 #zeitgeist { 149 125 float: left; … … 157 133 } 158 134 159 #moremeta fieldset div { 160 margin: 2px 0px 0 0; 135 #categorydiv ul { 136 margin-left: auto; 137 margin-right: 10px; 161 138 } 139 140 #moremeta fieldset div { margin: 2px 0px 0 0; } 141 162 142 #moremeta { 163 143 margin-right: auto; … … 166 146 left: 5%; 167 147 } 168 #categorydiv ul {169 margin-left: auto;170 margin-right: 10px;171 }172 173 #your-profile legend {174 font-family: Tahoma, Georgia, "Times New Roman", Times, serif;175 }176 148 177 149 #moremeta .dbx-content { 178 150 background: url(images/box-butt.gif) no-repeat bottom left; 179 padding-right: auto;151 padding-right: 0; 180 152 padding-left: 2px; 181 153 } 182 154 183 #moremeta .dbx-handle { 184 background: #2685af url(images/box-head.gif) no-repeat left; 185 } 155 #moremeta .dbx-handle { background: #2685af url(images/box-head.gif) no-repeat left; } 186 156 187 #moremeta .dbx-box { 188 background: url(images/box-bg.gif) repeat-y left; 189 } 157 #moremeta .dbx-box { background: url(images/box-bg.gif) repeat-y left; } 190 158 191 159 a.dbx-toggle, a.dbx-toggle:visited { … … 215 183 216 184 #postdivrich #edButtons { 217 padding-left: auto;185 padding-left: 0; 218 186 padding-right: 3px; 219 187 } 220 188 221 #edButtons input, #edButtons input:active { 222 margin: 0px 0 -1px 2px; 189 .page-numbers { 190 margin-right: auto; 191 margin-left: 3px; 223 192 } -
trunk/wp-admin/upload-js.php
r797 r804 222 222 223 223 if ( 'none' != link ) 224 h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment " ) ) + "' title='" + this.currentImage.title + "'>";224 h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment wp-att-" + this.currentImage.ID + "'" ) ) + "' title='" + this.currentImage.title + "'>"; 225 225 if ( display ) 226 226 h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />"; -
trunk/wp-admin/upload-rtl.css
r789 r804 1 body { font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana; }1 table { float: right; } 2 2 3 #upload-menu li { margin: 0 .75em 0 0; } 3 #upload-file th, #the-attachment-links textarea { text-align: left; } 4 5 h2 { margin: 0 0 0 .2em; } 6 7 #upload-files li { margin: 0 15px 15px 0; } 8 9 #upload-file-view { padding: 0 75px 0 0; } 10 11 #upload-menu li { 12 margin: 0 .75em 0 0; 13 display: block; 14 float: right; 15 } 4 16 5 17 #upload-menu .current div { … … 8 20 } 9 21 10 #upload-file-view { 0 15px 0 0 } 22 #upload-file { 23 left: auto; 24 right: 0; 25 } 11 26 12 #file-title { margin: 0 15px .2em 0; } 27 #file-title { 28 margin: 0 75px .2em 0; 29 font-family: Tahoma, Georgia, "Times New Roman", Times, serif; 30 } 13 31 14 h2 { margin: 0 0 0 .2em; } 32 .back { 33 left: auto; 34 right: 14px; 35 } 15 36 16 #upload-files li { margin: 0 15px 15px 0; } 17 18 table { float: right; } 19 20 #the-attachment-links { float: left; } 21 22 #th { text-align: left; } 37 #uploadoptions td { 38 padding-left: 0; 39 padding-right: 1em; 40 } -
trunk/wp-admin/upload.css
r797 r804 63 63 } 64 64 65 #u upload-file th {65 #upload-file th { 66 66 width: 8em; 67 67 } -
trunk/wp-admin/user-edit.php
r797 r804 163 163 </label></p> 164 164 165 <p><label><?php _e('Jabber / Google Talk:') ?> 165 <p><label><?php _e('Jabber / Google Talk:') ?><br /> 166 166 <input type="text" name="jabber" value="<?php echo $profileuser->jabber ?>" /></label> 167 167 </p> -
trunk/wp-admin/wp-admin.css
r797 r804 459 459 } 460 460 461 input.disabled, textarea.disabled { 462 background: #ccc; 463 } 464 461 465 #adminmenu { 462 466 background: #83B4D8; … … 506 510 margin: 0; 507 511 padding: 3px 2em 0 3em; 508 height: 25px;509 512 } 510 513 … … 534 537 #submenu li { 535 538 line-height: 180%; 539 height: 25px; 536 540 } 537 541 -
trunk/wp-includes/comment.php
r789 r804 200 200 201 201 // The author and the admins get respect. 202 if ( $userdata && ( $user_id == $post_author || $user->has_cap('level_9') ) ) {202 if ( $userdata && is_site_admin( $userdata->user_login ) == false && ( $user_id == $post_author || $user->has_cap('level_9' ) ) ) { 203 203 $approved = 1; 204 204 } -
trunk/wp-includes/feed.php
r789 r804 24 24 $content = get_the_content($more_link_text, $stripteaser, $more_file); 25 25 $content = apply_filters('the_content_rss', $content); 26 if ( $cut && !$encode_html) {26 if ( $cut && !$encode_html ) 27 27 $encode_html = 2; 28 } 29 if ($encode_html == 1) { 28 if ( 1== $encode_html ) { 30 29 $content = wp_specialchars($content); 31 30 $cut = 0; 32 } elseif ( $encode_html == 0) {31 } elseif ( 0 == $encode_html ) { 33 32 $content = make_url_footnote($content); 34 } elseif ( $encode_html == 2) {33 } elseif ( 2 == $encode_html ) { 35 34 $content = strip_tags($content); 36 35 } 37 if ( $cut) {36 if ( $cut ) { 38 37 $blah = explode(' ', $content); 39 if ( count($blah) > $cut) {38 if ( count($blah) > $cut ) { 40 39 $k = $cut; 41 40 $use_dotdotdot = 1; … … 44 43 $use_dotdotdot = 0; 45 44 } 46 for ( $i=0; $i<$k; $i++) {45 for ( $i=0; $i<$k; $i++ ) { 47 46 $excerpt .= $blah[$i].' '; 48 47 } … … 60 59 61 60 function permalink_single_rss($file = '') { 62 echo get_permalink();61 echo get_permalink(); 63 62 } 64 63 … … 88 87 global $id; 89 88 90 if ( '' != get_option('permalink_structure'))89 if ( '' != get_option('permalink_structure') ) 91 90 $url = trailingslashit( get_permalink() ) . 'feed/'; 92 91 else … … 97 96 98 97 function get_author_rss_link($echo = false, $author_id, $author_nicename) { 99 $auth_ID = $author_id;100 $permalink_structure = get_option('permalink_structure');98 $auth_ID = $author_id; 99 $permalink_structure = get_option('permalink_structure'); 101 100 102 if ('' == $permalink_structure) { 103 $link = get_option('home') . '?feed=rss2&author=' . $author_id; 104 } else { 105 $link = get_author_posts_url($author_id, $author_nicename); 106 $link = $link . "feed/"; 107 } 108 109 $link = apply_filters('author_feed_link', $link); 101 if ( '' == $permalink_structure ) { 102 $link = get_option('home') . '?feed=rss2&author=' . $author_id; 103 } else { 104 $link = get_author_posts_url($author_id, $author_nicename); 105 $link = $link . "feed/"; 106 } 110 107 111 if ($echo) echo $link; 112 return $link; 108 $link = apply_filters('author_feed_link', $link); 109 110 if ( $echo ) 111 echo $link; 112 return $link; 113 113 } 114 114 115 115 function get_category_rss_link($echo = false, $cat_ID, $category_nicename) { 116 $permalink_structure = get_option('permalink_structure');116 $permalink_structure = get_option('permalink_structure'); 117 117 118 if ('' == $permalink_structure) {119 $link = get_option('home') . '?feed=rss2&cat=' . $cat_ID;120 } else {121 $link = get_category_link($cat_ID);122 $link = $link . "feed/";123 }118 if ( '' == $permalink_structure ) { 119 $link = get_option('home') . '?feed=rss2&cat=' . $cat_ID; 120 } else { 121 $link = get_category_link($cat_ID); 122 $link = $link . "feed/"; 123 } 124 124 125 $link = apply_filters('category_feed_link', $link);125 $link = apply_filters('category_feed_link', $link); 126 126 127 if ($echo) echo $link; 128 return $link; 127 if ( $echo ) 128 echo $link; 129 return $link; 129 130 } 130 131 131 132 function get_the_category_rss($type = 'rss') { 132 $categories = get_the_category(); 133 $the_list = ''; 134 foreach ($categories as $category) { 135 $category->cat_name = convert_chars($category->cat_name); 136 if ('rdf' == $type) { 137 $the_list .= "\n\t\t<dc:subject>$category->cat_name</dc:subject>\n"; 138 } else { 139 $the_list .= "\n\t\t<category>$category->cat_name</category>\n"; 140 } 141 } 142 return apply_filters('the_category_rss', $the_list, $type); 133 $categories = get_the_category(); 134 $the_list = ''; 135 foreach ( (array) $categories as $category ) { 136 $category->cat_name = convert_chars($category->cat_name); 137 if ( 'rdf' == $type ) 138 $the_list .= "\n\t\t<dc:subject>$category->cat_name</dc:subject>\n"; 139 else 140 $the_list .= "\n\t\t<category>$category->cat_name</category>\n"; 141 } 142 return apply_filters('the_category_rss', $the_list, $type); 143 143 } 144 144 … … 149 149 function rss_enclosure() { 150 150 global $id, $post; 151 if (!empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password)) return; 151 if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) 152 return; 152 153 153 154 $custom_fields = get_post_custom(); 154 if ( is_array( $custom_fields) ) {155 while ( list( $key, $val ) = each( $custom_fields) ) {156 if ( $key == 'enclosure' ) {157 if ( is_array($val)) {158 foreach ($val as $enc) {155 if ( is_array($custom_fields) ) { 156 while ( list($key, $val) = each($custom_fields) ) { 157 if ( $key == 'enclosure' ) { 158 if ( is_array($val) ) { 159 foreach ( (array) $val as $enc ) { 159 160 $enclosure = split( "\n", $enc ); 160 161 print "<enclosure url='".trim( htmlspecialchars($enclosure[ 0 ]) )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n"; -
trunk/wp-includes/formatting.php
r797 r804 286 286 } 287 287 288 function sanitize_file( $name ) { // Like sanitize_title, but with periods 289 $name = strtolower( $name ); 290 $name = preg_replace('/&.+?;/', '', $name); // kill entities 291 $name = str_replace( '_', '-', $name ); 292 $name = preg_replace('/[^a-z0-9\s-.]/', '', $name); 293 $name = preg_replace('/\s+/', '-', $name); 294 $name = preg_replace('|-+|', '-', $name); 295 $name = trim($name, '-'); 296 return $name; 297 } 298 288 299 function sanitize_user( $username, $strict = false ) { 289 300 $raw_username = $username; … … 596 607 function make_clickable($ret) { 597 608 $ret = ' ' . $ret; 598 $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "$1<a href='$2' rel='nofollow'>$2</a>", $ret); 599 $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "$1<a href='http://$2' rel='nofollow'>$2</a>", $ret); 600 $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret); 601 $ret = substr($ret, 1); 609 // in testing, using arrays here was found to be faster 610 $ret = preg_replace( 611 array( 612 '#([\s>])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is', 613 '#([\s>])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is', 614 '#([\s>])([a-z0-9\-_.]+)@([^,< \n\r]+)#i'), 615 array( 616 '$1<a href="$2" rel="nofollow">$2</a>', 617 '$1<a href="http://$2" rel="nofollow">$2</a>', 618 '$1<a href="mailto:$2@$3">$2@$3</a>'),$ret); 619 // this one is not in an array because we need it to run last, for cleanup of accidental links within links 620 $ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret); 602 621 $ret = trim($ret); 603 622 return $ret; … … 619 638 // HTML loop taken from texturize function, could possible be consolidated 620 639 $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between 621 $output = implode('', preg_replace($wp_smiliessearch, $wp_smiliesreplace, $textarr)); 640 $stop = count($textarr);// loop stuff 641 for ($i = 0; $i < $stop; $i++) { 642 $content = $textarr[$i]; 643 if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag 644 $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content); 645 } 646 $output .= $content; 647 } 622 648 } else { 623 649 // return default text. -
trunk/wp-includes/functions.php
r802 r804 157 157 158 158 function maybe_unserialize($original) { 159 if ( false !== $gm = @ unserialize($original) ) 160 return $gm; 161 else 162 return $original; 159 if ( is_serialized($original) ) // don't attempt to unserialize data that wasn't serialized going in 160 if ( false !== $gm = @ unserialize($original) ) 161 return $gm; 162 return $original; 163 } 164 165 function is_serialized($data) { 166 // if it isn't a string, it isn't serialized 167 if ( !is_string($data) ) 168 return false; 169 $data = trim($data); 170 if ( 'N;' == $data ) 171 return true; 172 if ( !preg_match('/^([adObis]):/', $data, $badions) ) 173 return false; 174 switch ( $badions[1] ) : 175 case 'a' : 176 case 'O' : 177 case 's' : 178 if ( preg_match("/^{$badions[1]}:[0-9]+:.*[;}]\$/s", $data) ) 179 return true; 180 break; 181 case 'b' : 182 case 'i' : 183 case 'd' : 184 if ( preg_match("/^{$badions[1]}:[0-9.E-]+;\$/", $data) ) 185 return true; 186 break; 187 endswitch; 188 return false; 189 } 190 191 function is_serialized_string($data) { 192 // if it isn't a string, it isn't a serialized string 193 if ( !is_string($data) ) 194 return false; 195 $data = trim($data); 196 if ( preg_match('/^s:[0-9]+:.*;$/s',$data) ) // this should fetch all serialized strings 197 return true; 198 return false; 163 199 } 164 200 165 201 /* Options functions */ 166 167 function is_switched( $setting = 'N/A' ) {168 global $switched;169 if ( $switched == false && defined('WP_INSTALLING') == false && $_REQUEST['nomemcache'] != 'all' && $_REQUEST['nomemcache'] != $setting ) {170 return false;171 } else {172 return true;173 }174 175 }176 202 177 203 function get_option($setting) { 178 204 global $wpdb, $switched, $current_blog; 179 205 180 if ( is_switched() == false ) {206 if ( $switched == false && defined('WP_INSTALLING') == false ) { 181 207 $value = wp_cache_get($setting, 'options'); 182 208 } else { … … 267 293 268 294 $_newvalue = $newvalue; 269 if ( is_array($newvalue) || is_object($newvalue) ) 270 $newvalue = serialize($newvalue); 271 272 wp_cache_set($option_name, $newvalue, 'options'); 295 $newvalue = maybe_serialize($newvalue); 296 297 wp_cache_delete($option_name, 'options'); 273 298 274 299 $newvalue = $wpdb->escape($newvalue); … … 290 315 return; 291 316 292 if ( is_array($value) || is_object($value) ) 293 $value = serialize($value); 294 295 wp_cache_set($name, $value, 'options'); 317 $value = maybe_serialize($value); 318 319 wp_cache_delete($name, 'options'); 296 320 297 321 $name = $wpdb->escape($name); … … 311 335 wp_cache_delete($name, 'options'); 312 336 return true; 337 } 338 339 function maybe_serialize($data) { 340 if ( is_string($data) ) 341 $data = trim($data); 342 elseif ( is_array($data) || is_object($data) ) 343 return serialize($data); 344 if ( is_serialized($data) ) 345 return serialize($data); 346 return $data; 313 347 } 314 348 … … 569 603 update_post_category_cache($post_id_list); 570 604 605 update_postmeta_cache($post_id_list); 606 } 607 608 function update_postmeta_cache($post_id_list = '') { 609 global $wpdb, $post_meta_cache, $blog_id; 610 611 // We should validate this comma-separated list for the upcoming SQL query 612 $post_id_list = preg_replace('|[^0-9,]|', '', $post_id_list); 613 614 // we're marking each post as having its meta cached (with no keys... empty array), to prevent posts with no meta keys from being queried again 615 // any posts that DO have keys will have this empty array overwritten with a proper array, down below 616 $post_id_array = explode(',', $post_id_list); 617 foreach ( (array) $post_id_array as $pid ) 618 $post_meta_cache[$blogi_id][$pid] = array(); 619 571 620 // Get post-meta info 572 621 if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id IN($post_id_list) ORDER BY post_id, meta_key", ARRAY_A) ) { 573 622 // Change from flat structure to hierarchical: 574 $post_meta_cache[$blog_id] = array(); 623 if ( !isset($post_meta_cache) ) 624 $post_meta_cache[$blog_id] = array(); 625 575 626 foreach ($meta_list as $metarow) { 576 627 $mpid = (int) $metarow['post_id']; … … 656 707 657 708 foreach($qs as $k => $v) { 658 if ( $v != '') {709 if ( $v !== FALSE ) { 659 710 if ( $ret != '' ) 660 711 $ret .= '&'; 661 $ret .= "$k=$v"; 712 if ( empty($v) && !preg_match('|[?&]' . preg_quote($k, '|') . '=|', $query) ) 713 $ret .= $k; 714 else 715 $ret .= "$k=$v"; 662 716 } 663 717 } … … 681 735 if ( is_array($key) ) { // removing multiple keys 682 736 foreach ( (array) $key as $k ) 683 $query = add_query_arg($k, '', $query);737 $query = add_query_arg($k, FALSE, $query); 684 738 return $query; 685 739 } 686 return add_query_arg($key, '', $query);740 return add_query_arg($key, FALSE, $query); 687 741 } 688 742 … … 743 797 $text = 'Gone'; 744 798 745 @header("HTTP/1.1 $header $text"); 746 @header("Status: $header $text"); 799 if ( substr(php_sapi_name(), 0, 3) == 'cgi' ) 800 @header("Status: $header $text"); 801 else 802 @header("HTTP/1.1 $header $text"); 747 803 } 748 804 … … 1143 1199 ?> 1144 1200 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 1145 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>1201 <html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists('language_attributes') ) language_attributes(); ?>> 1146 1202 <head> 1147 1203 <title><?php echo $title ?></title> … … 1214 1270 return $input; 1215 1271 } 1216 1217 1272 ?> -
trunk/wp-includes/general-template.php
r802 r804 339 339 if ( !$arcresults ) { 340 340 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit); 341 wp_cache_set( md5('archives' . $type . $limit), $arcresults, 'general', 600 );341 wp_cache_set( md5('archives' . $type . $limit), $arcresults, 'general', 86400 ); 342 342 } 343 343 if ( $arcresults ) { … … 754 754 if ( '0' == $current_blog->public ) 755 755 echo "<meta name='robots' content='noindex,nofollow' />\n"; 756 } 757 758 function rich_edit_exists() { 759 global $wp_rich_edit_exists; 760 if ( !isset($wp_rich_edit_exists) ) 761 $wp_rich_edit_exists = file_exists(ABSPATH . WPINC . '/js/tinymce/tiny_mce.js'); 762 return $wp_rich_edit_exists; 756 763 } 757 764 -
trunk/wp-includes/js/autosave.js.php
r770 r804 3 3 ?> 4 4 var autosaveLast = ''; 5 function autosave_timer() { 6 autosave(); 7 setTimeout("autosave_timer()", <?php echo apply_filters('autosave_interval', '60000') ?>); 8 } 9 5 var autosavePeriodical; 10 6 function autosave_start_timer() { 11 7 var form = $('post'); 12 8 autosaveLast = form.post_title.value+form.content.value; 13 setTimeout("autosave_timer()", <?php echo apply_filters('autosave_start_delay', '60000')?>);9 autosavePeriodical = new PeriodicalExecuter(autosave, <?php echo apply_filters('autosave_interval', '60'); ?>); 14 10 } 15 11 addLoadEvent(autosave_start_timer) … … 81 77 autosaveAjax.setVar("content", form.content.value); 82 78 } else { 79 // Don't run while the TinyMCE spellcheck is on. 83 80 if(tinyMCE.selectedInstance.spellcheckerOn) return; 84 81 tinyMCE.wpTriggerSave(); -
trunk/wp-includes/js/list-manipulation-js.php
r795 r804 53 53 }); 54 54 } 55 ajaxAdd.myResponseElement.update(tempObj.showLink ? ( "<div id='jumplink' class='updated fade'><p><a href='#" + what + '-' + tempObj.showLink + "'><?php echo wp_specialchars(__('Jump to new item'), 1); ?></a></p></div>" ) : '');55 ajaxAdd.myResponseElement.update(tempObj.showLink ? ( "<div id='jumplink' class='updated fade'><p><a href='#" + what + '-' + tempObj.showLink + "'><?php _e('Jump to new item'); ?></a></p></div>" ) : ''); 56 56 if ( tempObj.addComplete && typeof tempObj.addComplete == 'function' ) 57 57 tempObj.addComplete( what, where, update, transport ); -
trunk/wp-includes/link-template.php
r789 r804 245 245 } 246 246 247 $location = get_option('siteurl') . "/wp-admin/comment.php?action=editcomment&c omment=$comment->comment_ID";247 $location = get_option('siteurl') . "/wp-admin/comment.php?action=editcomment&c=$comment->comment_ID"; 248 248 echo $before . "<a href='$location'>$link</a>" . $after; 249 249 } -
trunk/wp-includes/pluggable.php
r797 r804 79 79 if ($metavalues) { 80 80 foreach ( $metavalues as $meta ) { 81 @ $value = unserialize($meta->meta_value); 82 if ($value === FALSE) 83 $value = $meta->meta_value; 81 $value = maybe_unserialize($meta->meta_value); 84 82 $user->{$meta->meta_key} = $value; 85 83 … … 132 130 if ($metavalues) { 133 131 foreach ( $metavalues as $meta ) { 134 @ $value = unserialize($meta->meta_value); 135 if ($value === FALSE) 136 $value = $meta->meta_value; 132 $value = maybe_unserialize($meta->meta_value); 137 133 $user->{$meta->meta_key} = $value; 138 134 … … 230 226 wp_clearcookie(); 231 227 232 wp_redirect(get_option('siteurl') . '/wp-login.php? redirect_to=' . urlencode($_SERVER['REQUEST_URI']));228 wp_redirect(get_option('siteurl') . '/wp-login.php?action=auth&redirect_to=' . urlencode($_SERVER['REQUEST_URI'])); 233 229 exit(); 234 230 } … … 268 264 function wp_redirect($location, $status = 302) { 269 265 global $is_IIS; 266 267 $location = apply_filters('wp_redirect', $location, $status); 268 269 if ( !$location ) // allows the wp_redirect filter to cancel a redirect 270 return false; 270 271 271 272 $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location); … … 377 378 } 378 379 $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; 379 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl'). '/wp-admin/comment.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";380 $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl'). '/wp-admin/comment.php?action=confirmdeletecomment&delete_type=spam&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";380 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n"; 381 $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n"; 381 382 382 383 $admin_email = get_option('admin_email'); … … 434 435 $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n"; 435 436 $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 436 $notify_message .= sprintf( __('To approve this comment, visit: %s'), get_option('siteurl'). '/wp-admin/comment.php?action=mailapprovecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";437 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl'). '/wp-admin/comment.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";438 $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl'). '/wp-admin/comment.php?action=confirmdeletecomment&delete_type=spam&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";437 $notify_message .= sprintf( __('To approve this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n"; 438 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n"; 439 $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n"; 439 440 $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n"; 440 441 $notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n"; -
trunk/wp-includes/plugin.php
r797 r804 13 13 // uncomment if we want to match function AND accepted_args 14 14 // if ( $filter == array($function, $accepted_args) ) { 15 if ( $filter['function'] == $function_to_add ) {15 if ( $filter['function'] == $function_to_add ) 16 16 return true; 17 }18 17 } 19 18 } … … 33 32 merge_filters($tag); 34 33 35 if ( !isset($wp_filter[$tag]) ) {34 if ( !isset($wp_filter[$tag]) ) 36 35 return $string; 37 } 38 foreach ( $wp_filter[$tag] as $priority => $functions) {36 37 foreach ( (array) $wp_filter[$tag] as $priority => $functions ) { 39 38 if ( !is_null($functions) ) { 40 foreach($functions as $function) { 41 39 foreach ( (array) $functions as $function ) { 42 40 $function_name = $function['function']; 43 41 $accepted_args = $function['accepted_args']; 44 45 42 $the_args = $args; 46 43 array_unshift($the_args, $string); 47 44 if ( $accepted_args > 0 ) 48 45 $the_args = array_slice($the_args, 0, $accepted_args); 49 elseif ( $accepted_args == 0)46 elseif ( 0 == $accepted_args ) 50 47 $the_args = NULL; 51 52 48 $string = call_user_func_array($function_name, $the_args); 53 49 } … … 57 53 } 58 54 59 60 55 function merge_filters($tag) { 61 56 global $wp_filter; 62 57 if ( isset($wp_filter['all']) ) { 63 foreach ( $wp_filter['all'] as $priority => $functions) {58 foreach ( (array) $wp_filter['all'] as $priority => $functions ) { 64 59 if ( isset($wp_filter[$tag][$priority]) ) 65 60 $wp_filter[$tag][$priority] = array_merge($wp_filter['all'][$priority], $wp_filter[$tag][$priority]); … … 74 69 } 75 70 76 77 78 71 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) { 79 72 global $wp_filter; … … 82 75 if ( isset($wp_filter[$tag]["$priority"]) ) { 83 76 $new_function_list = array(); 84 foreach ($wp_filter[$tag]["$priority"] as $filter) {85 if ( $filter['function'] != $function_to_remove ) {77 foreach ( (array) $wp_filter[$tag]["$priority"] as $filter ) { 78 if ( $filter['function'] != $function_to_remove ) 86 79 $new_function_list[] = $filter; 87 }88 80 } 89 81 $wp_filter[$tag]["$priority"] = $new_function_list; … … 116 108 return; 117 109 118 foreach ( $wp_filter[$tag] as $priority => $functions) {110 foreach ( (array) $wp_filter[$tag] as $priority => $functions ) { 119 111 if ( !is_null($functions) ) { 120 foreach($functions as $function) { 121 112 foreach ( (array) $functions as $function ) { 122 113 $function_name = $function['function']; 123 114 $accepted_args = $function['accepted_args']; … … 161 152 return; 162 153 163 foreach ( $wp_filter[$tag] as $priority => $functions) {154 foreach ( (array) $wp_filter[$tag] as $priority => $functions ) { 164 155 if ( !is_null($functions) ) { 165 foreach($functions as $function) { 166 156 foreach( (array) $functions as $function ) { 167 157 $function_name = $function['function']; 168 158 $accepted_args = $function['accepted_args']; 169 170 159 if ( $accepted_args > 0 ) 171 160 $the_args = array_slice($args, 0, $accepted_args); 172 elseif ( $accepted_args == 0)161 elseif ( 0 == $accepted_args ) 173 162 $the_args = NULL; 174 163 else … … 197 186 function register_activation_hook($file, $function) { 198 187 $file = plugin_basename($file); 199 200 188 add_action('activate_' . $file, $function); 201 189 } … … 203 191 function register_deactivation_hook($file, $function) { 204 192 $file = plugin_basename($file); 205 206 193 add_action('deactivate_' . $file, $function); 207 194 } -
trunk/wp-includes/post.php
r802 r804 230 230 } 231 231 232 $original = $value; 233 if ( is_array($value) || is_object($value) ) 234 $value = $wpdb->escape(serialize($value)); 232 $post_meta_cache[$blog_id][$post_id][$key][] = $original; 233 234 $value = maybe_serialize($value); 235 $value = $wpdb->escape($value); 235 236 236 237 $wpdb->query("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value) VALUES ('$post_id','$key','$value')"); 237 238 $post_meta_cache[$blog_id][$post_id][$key][] = $original;239 238 240 239 return true; … … 276 275 $post_id = (int) $post_id; 277 276 278 if ( isset($post_meta_cache[$blog_id][$post_id][$key]) ) { 279 if ( $single ) { 280 return maybe_unserialize( $post_meta_cache[$blog_id][$post_id][$key][0] ); 281 } else { 282 return maybe_unserialize( $post_meta_cache[$blog_id][$post_id][$key] ); 283 } 284 } 285 286 $metalist = $wpdb->get_results("SELECT meta_value FROM $wpdb->postmeta WHERE post_id = '$post_id' AND meta_key = '$key'", ARRAY_N); 287 288 $values = array(); 289 if ( $metalist ) { 290 foreach ($metalist as $metarow) { 291 $values[] = $metarow[0]; 292 } 293 } 277 if ( !isset($post_meta_cache[$blog_id][$post_id]) ) 278 update_postmeta_cache($post_id); 294 279 295 280 if ( $single ) { 296 if ( count($values) ) {297 $return = maybe_unserialize( $values[0]);298 } else {281 if ( isset($post_meta_cache[$blog_id][$post_id][$key][0]) ) 282 return maybe_unserialize($post_meta_cache[$blog_id][$post_id][$key][0]); 283 else 299 284 return ''; 300 } 301 } else { 302 $return = $values; 303 } 304 305 return maybe_unserialize($return); 285 } else { 286 return maybe_unserialize($post_meta_cache[$blog_id][$post_id][$key]); 287 } 306 288 } 307 289 … … 312 294 313 295 $original_value = $value; 314 if ( is_array($value) || is_object($value) )315 $value = $wpdb->escape(serialize($value));296 $value = maybe_serialize($value); 297 $value = $wpdb->escape($value); 316 298 317 299 $original_prev = $prev_value; 318 if ( is_array($prev_value) || is_object($prev_value) )319 $prev_value = $wpdb->escape(serialize($prev_value));300 $prev_value = maybe_serialize($prev_value); 301 $prev_value = $wpdb->escape($prev_value); 320 302 321 303 if (! $wpdb->get_var("SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = '$key' AND post_id = '$post_id'") ) { … … 342 324 343 325 344 function get_post_custom( $post_id = 0) {326 function get_post_custom($post_id = 0) { 345 327 global $id, $post_meta_cache, $wpdb, $blog_id; 346 328 347 if ( ! $post_id )329 if ( !$post_id ) 348 330 $post_id = $id; 349 331 350 332 $post_id = (int) $post_id; 351 333 352 if ( isset($post_meta_cache[$blog_id][$post_id]) ) 353 return $post_meta_cache[$blog_id][$post_id]; 354 355 if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = '$post_id' ORDER BY post_id, meta_key", ARRAY_A) ) { 356 // Change from flat structure to hierarchical: 357 $post_meta_cache = array(); 358 foreach ( $meta_list as $metarow ) { 359 $mpid = (int) $metarow['post_id']; 360 $mkey = $metarow['meta_key']; 361 $mval = $metarow['meta_value']; 362 363 // Force subkeys to be array type: 364 if ( !isset($post_meta_cache[$blog_id][$mpid]) || !is_array($post_meta_cache[$blog_id][$mpid]) ) 365 $post_meta_cache[$blog_id][$mpid] = array(); 366 367 if ( !isset($post_meta_cache[$blog_id][$mpid]["$mkey"]) || !is_array($post_meta_cache[$blog_id][$mpid]["$mkey"]) ) 368 $post_meta_cache[$blog_id][$mpid]["$mkey"] = array(); 369 370 // Add a value to the current pid/key: 371 $post_meta_cache[$blog_id][$mpid][$mkey][] = $mval; 372 } 373 return $post_meta_cache[$blog_id][$mpid]; 374 } 334 if ( !isset($post_meta_cache[$blog_id][$post_id]) ) 335 update_postmeta_cache($post_id); 336 337 return $post_meta_cache[$blog_id][$post_id]; 375 338 } 376 339 … … 378 341 $custom = get_post_custom( $post_id ); 379 342 380 if ( ! is_array($custom) )343 if ( !is_array($custom) ) 381 344 return; 382 345 … … 980 943 return get_page($page->ID, $output); 981 944 } 945 946 return NULL; 947 } 948 949 function get_page_by_title($page_title, $output = OBJECT) { 950 global $wpdb; 951 $page_title = $wpdb->escape($page_title); 952 $page = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$page_title' AND post_type='page'"); 953 if ( $page ) 954 return get_page($page, $output); 982 955 983 956 return NULL; … … 1306 1279 1307 1280 if ( $file ) 1308 add_post_meta($post_ID, '_wp_attached_file', quotemeta( $file ));1281 add_post_meta($post_ID, '_wp_attached_file', $file); 1309 1282 1310 1283 clean_post_cache($post_ID); -
trunk/wp-includes/query.php
r770 r804 255 255 class WP_Query { 256 256 var $query; 257 var $query_vars ;257 var $query_vars = array(); 258 258 var $queried_object; 259 259 var $queried_object_id; … … 316 316 unset($this->posts); 317 317 unset($this->query); 318 unset($this->query_vars);318 $this->query_vars = array(); 319 319 unset($this->queried_object); 320 320 unset($this->queried_object_id); … … 744 744 // If a search pattern is specified, load the posts that match 745 745 if (!empty($q['s'])) { 746 $q['s'] = addslashes_gpc($q['s']); 747 $search = ' AND ('; 748 $q['s'] = preg_replace('/, +/', ' ', $q['s']); 749 $q['s'] = str_replace(',', ' ', $q['s']); 750 $q['s'] = str_replace('"', ' ', $q['s']); 751 $q['s'] = trim($q['s']); 752 if ($q['exact']) { 753 $n = ''; 754 } else { 755 $n = '%'; 756 } 757 if (!$q['sentence']) { 758 $s_array = explode(' ',$q['s']); 759 $q['search_terms'] = $s_array; 760 $search .= '((post_title LIKE \''.$n.$s_array[0].$n.'\') OR (post_content LIKE \''.$n.$s_array[0].$n.'\'))'; 761 for ( $i = 1; $i < count($s_array); $i = $i + 1) { 762 $search .= ' AND ((post_title LIKE \''.$n.$s_array[$i].$n.'\') OR (post_content LIKE \''.$n.$s_array[$i].$n.'\'))'; 763 } 764 $search .= ' OR (post_title LIKE \''.$n.$q['s'].$n.'\') OR (post_content LIKE \''.$n.$q['s'].$n.'\')'; 765 $search .= ')'; 766 } else { 767 $search = ' AND ((post_title LIKE \''.$n.$q['s'].$n.'\') OR (post_content LIKE \''.$n.$q['s'].$n.'\'))'; 768 } 746 // added slashes screw with quote grouping when done early, so done later 747 $q['s'] = stripslashes($q['s']); 748 if ($q['sentence']) { 749 $q['search_terms'] = array($q['s']); 750 } 751 else { 752 preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q[s], $matches); 753 $q['search_terms'] = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]); 754 } 755 $n = ($q['exact']) ? '' : '%'; 756 $searchand = ''; 757 foreach((array)$q['search_terms'] as $term) { 758 $term = addslashes_gpc($term); 759 $search .= "{$searchand}((post_title LIKE '{$n}{$term}{$n}') OR (post_content LIKE '{$n}{$term}{$n}'))"; 760 $searchand = ' AND '; 761 } 762 $term = addslashes_gpc($q['s']); 763 if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] ) $search .= " OR (post_title LIKE '{$n}{$term}{$n}') OR (post_content LIKE '{$n}{$term}{$n}')"; 764 765 $search = " AND ({$search}) "; 769 766 } 770 767 -
trunk/wp-includes/user.php
r559 r804 115 115 $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); 116 116 117 if ( is_array($meta_value) || is_object($meta_value) ) 118 $meta_value = serialize($meta_value); 119 $meta_value = trim( $meta_value ); 117 // FIXME: usermeta data is assumed to be already escaped 118 if ( is_string($meta_value) ) 119 $meta_value = stripslashes($meta_value); 120 $meta_value = maybe_serialize($meta_value); 121 $meta_value = $wpdb->escape($meta_value); 120 122 121 123 if (empty($meta_value)) { -
trunk/wp-includes/wpmu-functions.php
r797 r804 419 419 } 420 420 421 function get_blogs_of_user( $id ) {421 function get_blogs_of_user( $id, $all = false ) { 422 422 global $wpdb, $wpmuBaseTablePrefix; 423 423 … … 434 434 preg_match('/wp_(\d+)_capabilities/', $key, $match); 435 435 $blog = get_blog_details( $match[1] ); 436 if ( $blog && $blog->deleted == 0 && isset( $blog->domain) ) {436 if ( $blog && isset( $blog->domain ) && ( $all == false && $blog->deleted == 0 || $all == true ) ) { 437 437 $blogs[$match[1]]->userblog_id = $match[1]; 438 438 $blogs[$match[1]]->domain = $blog->domain; … … 443 443 444 444 return $blogs; 445 } 446 447 function get_active_blog_for_user( $user_id ) { // get an active blog for user - either primary blog or from blogs list 448 $primary_blog = get_usermeta( $user_id, "primary_blog" ); 449 if( $primary_blog == false ) { 450 $details = false; 451 } else { 452 $details = get_blog_details( $primary_blog ); 453 } 454 455 if( ( is_object( $details ) == false ) || ( is_object( $details ) && $details->archived == 1 || $details->spam == 1 || $details->deleted == 1 ) ) { 456 $blogs = get_blogs_of_user( $user_id, true ); // if a user's primary blog is shut down, check their other blogs. 457 $ret = false; 458 if( is_array( $blogs ) && count( $blogs ) > 0 ) { 459 foreach( $blogs as $blog_id => $blog ) { 460 $details = get_blog_details( $blog_id ); 461 if( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) { 462 $ret = $blog; 463 break; 464 } 465 } 466 } else { 467 $ret = "username only"; // user has no blogs. We can add details for dashboard.wordpress.com here. 468 } 469 return $ret; 470 } else { 471 return $details; 472 } 473 } 474 475 function is_user_member_of_blog( $user_id, $blog_id = 0 ) { 476 global $wpdb; 477 if( $blog_id == 0 ) 478 $blog_id = $wpdb->blogid; 479 480 $blogs = get_blogs_of_user( $user_id ); 481 if( is_array( $blogs ) ) { 482 return array_key_exists( $blog_id, $blogs ); 483 } else { 484 return false; 485 } 445 486 } 446 487 -
trunk/wp-login.php
r797 r804 24 24 // Rather than duplicating this HTML all over the place, we'll stick it in function 25 25 function login_header($title = 'Login', $message = '') { 26 global $errors, $error, $wp_locale ;26 global $errors, $error, $wp_locale, $current_site; 27 27 28 28 ?> … … 134 134 135 135 do_action('lost_password'); 136 login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username and e-mail address. You will rec ieve a new password via e-mail.') . '</p>');136 login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username and e-mail address. You will receive a new password via e-mail.') . '</p>'); 137 137 ?> 138 138 … … 264 264 ?> 265 265 266 <form name="loginform" id="loginform" action=" wp-login.php" method="post">266 <form name="loginform" id="loginform" action="https://<?php echo $current_blog->domain . $current_blog->path ?>wp-login.php" method="post"> 267 267 <p> 268 268 <label><?php _e('Username:') ?><br /> -
trunk/wp-settings.php
r797 r804 91 91 92 92 define('WPINC', 'wp-includes'); 93 if ( !defined('LANGDIR') ) 94 define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash 93 94 if ( !defined('LANGDIR') ) { 95 if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') ) 96 define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash 97 else 98 define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash 99 } 100 95 101 if ( !defined('PLUGINDIR') ) 96 102 define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash -
trunk/xmlrpc.php
r797 r804 135 135 global $wpdb; 136 136 137 foreach ( $array as $k => $v) {137 foreach ( (array) $array as $k => $v ) { 138 138 if (is_array($v)) { 139 139 $this->escape($array[$k]);
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)