Changeset 9699
- Timestamp:
- 11/14/2008 11:01:16 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/async-upload.php
r8998 r9699 26 26 27 27 // just fetch the detail form for that attachment 28 if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {28 if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) { 29 29 if ( 2 == $_REQUEST['fetch'] ) { 30 30 add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); -
trunk/wp-admin/edit-link-form.php
r9637 r9699 344 344 <h2><?php echo wp_specialchars( $title ); ?></h2> 345 345 346 <?php 347 $link_added = ( isset($_GET['added']) && '' != $_POST['link_name'] ) ? 348 '<div id="message" class="updated fade"><p>' . __('Link added.') . '</p></div>' : ''; 349 ?> 350 351 <?php if ( isset( $_GET['added'] ) && '' != $_POST['link_name']) : ?> 346 <?php if ( isset( $_GET['added'] ) ) : ?> 352 347 <div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div> 353 348 <?php endif; ?> -
trunk/wp-admin/includes/bookmark.php
r9659 r9699 35 35 $_POST['link_image'] = wp_specialchars( $_POST['link_image'] ); 36 36 $_POST['link_rss'] = clean_url($_POST['link_rss']); 37 if ( 'N' != $_POST['link_visible'] )37 if ( !isset($_POST['link_visible']) || 'N' != $_POST['link_visible'] ) 38 38 $_POST['link_visible'] = 'Y'; 39 39 … … 177 177 178 178 // Make sure we set a valid category 179 if ( 0 == count( $link_category ) || !is_array( $link_category ) ) {179 if ( ! isset( $link_category ) ||0 == count( $link_category ) || !is_array( $link_category ) ) { 180 180 $link_category = array( get_option( 'default_link_category' ) ); 181 181 } -
trunk/wp-admin/includes/dashboard.php
r9694 r9699 178 178 179 179 // Posts 180 $num = number_format_i18n( $num_posts->publish );180 $num = isset($num_posts->publish) ? number_format_i18n( $num_posts->publish ) : 0; 181 181 if ( current_user_can( 'edit_posts' ) ) 182 $num = "<a href='edit.php'>$num</a>"; 183 echo '<td class="first b b-posts">'.$num.'</td>'; 184 echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', $num_posts->publish ) . '</td>'; 182 $text = "<a href='edit.php'>$num</a>"; 183 else 184 $text = $num; 185 echo '<td class="first b b-posts">' . $text . '</td>'; 186 echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', $num ) . '</td>'; 185 187 /* TODO: Show status breakdown on hover 186 188 if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can -
trunk/wp-admin/includes/file.php
r9664 r9699 224 224 // You may define your own function and pass the name in $overrides['upload_error_handler'] 225 225 $upload_error_handler = 'wp_handle_upload_error'; 226 227 // You may define your own function and pass the name in $overrides['unique_filename_callback'] 228 $unique_filename_callback = null; 226 229 227 230 // $_POST['action'] must be set and its value must equal $overrides['action'] or this: -
trunk/wp-admin/includes/media.php
r9676 r9699 210 210 211 211 // Save the data 212 $id = wp_insert_attachment($attachment, $file, $post_ parent);212 $id = wp_insert_attachment($attachment, $file, $post_id); 213 213 if ( !is_wp_error($id) ) { 214 214 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); … … 990 990 } 991 991 992 if ( empty($attachments) ) 993 return ''; 994 995 foreach ( $attachments as $id => $attachment ) 992 $output = ''; 993 foreach ( (array) $attachments as $id => $attachment ) 996 994 if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) ) 997 995 $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress'><div class='bar'></div></div><div id='media-upload-error-$id'></div><div class='filename'></div>$item\n</div>"; … … 1040 1038 } 1041 1039 1040 $type = ''; 1042 1041 if ( isset($post_mime_types) ) { 1043 1042 $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)); -
trunk/wp-admin/includes/post.php
r9651 r9699 154 154 wp_die( $post_data->get_error_message() ); 155 155 156 switch ( $post_data['visibility'] ) { 157 case 'public' : 158 unset( $post_data['post_password'] ); 159 break; 160 case 'password' : 161 unset( $post_data['sticky'] ); 162 break; 163 case 'private' : 164 $post_data['post_status'] = 'private'; 165 $post_data['post_password'] = ''; 166 unset( $post_data['sticky'] ); 167 break; 156 if ( isset($post_data['visibility']) ) { 157 switch ( $post_data['visibility'] ) { 158 case 'public' : 159 unset( $post_data['post_password'] ); 160 break; 161 case 'password' : 162 unset( $post_data['sticky'] ); 163 break; 164 case 'private' : 165 $post_data['post_status'] = 'private'; 166 $post_data['post_password'] = ''; 167 unset( $post_data['sticky'] ); 168 break; 169 } 168 170 } 169 171 … … 338 340 $post->post_author = ''; 339 341 $post->post_date = ''; 342 $post->post_password = ''; 340 343 $post->post_status = 'draft'; 341 344 $post->post_type = 'post'; … … 457 460 return $translated; 458 461 459 switch ( $_POST['visibility'] ) { 460 case 'public' : 461 $_POST['post_password'] = ''; 462 break; 463 case 'password' : 464 unset( $_POST['sticky'] ); 465 break; 466 case 'private' : 467 $_POST['post_status'] = 'private'; 468 $_POST['post_password'] = ''; 469 unset( $_POST['sticky'] ); 470 break; 462 if ( isset($_POST['visibility']) ) { 463 switch ( $_POST['visibility'] ) { 464 case 'public' : 465 $_POST['post_password'] = ''; 466 break; 467 case 'password' : 468 unset( $_POST['sticky'] ); 469 break; 470 case 'private' : 471 $_POST['post_status'] = 'private'; 472 $_POST['post_password'] = ''; 473 unset( $_POST['sticky'] ); 474 break; 475 } 471 476 } 472 477 -
trunk/wp-admin/user-new.php
r9631 r9699 23 23 24 24 $user_id = add_user(); 25 $update = 'add'; 26 if ( is_wp_error( $user_id ) ) 25 26 if ( is_wp_error( $user_id ) ) { 27 27 $add_user_errors = $user_id; 28 else {28 } else { 29 29 $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true)); 30 $redirect = add_query_arg( array('usersearch' => urlencode($new_user_login), 'update' => $update), $redirect );30 $redirect = 'users.php?usersearch='. urlencode($new_user_login) . '&update=add'; 31 31 wp_redirect( $redirect . '#user-' . $user_id ); 32 32 die(); … … 79 79 <form action="#add-new-user" method="post" name="adduser" id="adduser" class="add:users: validate"> 80 80 <?php wp_nonce_field('add-user') ?> 81 <?php 82 //Load up the passed data, else set to a default. 83 foreach ( array('user_login' => 'login', 'first_name' => 'firstname', 'last_name' => 'lastname', 84 'email' => 'email', 'url' => 'uri', 'role' => 'role') as $post_field => $var ) { 85 $var = "new_user_$var"; 86 if ( ! isset($$var) ) 87 $$var = isset($_POST[$post_field]) ? stripslashes($_POST[$post_field]) : ''; 88 } 89 ?> 81 90 <table class="form-table"> 82 91 <tr class="form-field form-required"> … … 115 124 <?php 116 125 if ( !$new_user_role ) 117 $new_user_role = $current_role? $current_role : get_option('default_role');126 $new_user_role = !empty($current_role) ? $current_role : get_option('default_role'); 118 127 wp_dropdown_roles($new_user_role); 119 128 ?> … … 123 132 </table> 124 133 <p class="submit"> 125 <?php echo $referer; ?>126 134 <input name="adduser" type="submit" id="addusersub" class="button" value="<?php _e('Add User') ?>" /> 127 135 </p> -
trunk/wp-includes/bookmark.php
r8758 r9699 266 266 'link_rel', 'link_notes', 'link_rss', ); 267 267 268 $do_object = false; 269 if ( is_object($bookmark) ) 268 if ( is_object($bookmark) ) { 270 269 $do_object = true; 270 $link_id = $bookmark->link_id; 271 } else { 272 $do_object = false; 273 $link_id = $bookmark['link_id']; 274 } 271 275 272 276 foreach ( $fields as $field ) { 273 if ( $do_object ) 274 $bookmark->$field = sanitize_bookmark_field($field, $bookmark->$field, $bookmark->link_id, $context); 275 else 276 $bookmark[$field] = sanitize_bookmark_field($field, $bookmark[$field], $bookmark['link_id'], $context); 277 if ( $do_object ) { 278 if ( isset($bookmark->$field) ) 279 $bookmark->$field = sanitize_bookmark_field($field, $bookmark->$field, $link_id, $context); 280 } else { 281 if ( isset($bookmark[$field]) ) 282 $bookmark[$field] = sanitize_bookmark_field($field, $bookmark[$field], $link_id, $context); 283 } 277 284 } 278 285 -
trunk/wp-includes/post.php
r9596 r9699 1678 1678 $tags = array(); 1679 1679 $tags = (is_array($tags)) ? $tags : explode( ',', trim($tags, " \n\t\r\0\x0B,") ); 1680 $tags = array_map('trim', $tags); //Trim whitespace from around the tags. 1680 1681 wp_set_object_terms($post_id, $tags, 'post_tag', $append); 1681 1682 } … … 2159 2160 $pages = $wpdb->get_results($query); 2160 2161 2161 if ( empty($pages) ) 2162 return apply_filters('get_pages', array(), $r); 2162 if ( empty($pages) ) { 2163 $page = apply_filters('get_pages', array(), $r); 2164 return $pages; 2165 } 2163 2166 2164 2167 // Update cache. … … 2262 2265 2263 2266 // Make sure we set a valid category 2264 if ( 0 == count($post_category) || !is_array($post_category)) {2267 if ( !isset($post_category) || 0 == count($post_category) || !is_array($post_category)) { 2265 2268 $post_category = array(get_option('default_category')); 2266 2269 } … … 2273 2276 2274 2277 // Are we updating or creating? 2275 $update = false;2276 2278 if ( !empty($ID) ) { 2277 2279 $update = true; 2278 2280 $post_ID = (int) $ID; 2281 } else { 2282 $update = false; 2283 $post_ID = 0; 2279 2284 } 2280 2285 … … 3242 3247 $return['post_type'] = 'revision'; 3243 3248 $return['post_name'] = $autosave ? "$post[ID]-autosave" : "$post[ID]-revision"; 3244 $return['post_date'] = $post['post_modified'];3245 $return['post_date_gmt'] = $post['post_modified_gmt'];3249 $return['post_date'] = isset($post['post_modified']) ? $post['post_modified'] : ''; 3250 $return['post_date_gmt'] = isset($post['post_modified_gmt']) ? $post['post_modified_gmt'] : ''; 3246 3251 3247 3252 return $return; -
trunk/wp-includes/registration.php
r9217 r9699 165 165 $use_ssl = 0; 166 166 167 if ( empty($jabber) ) 168 $jabber = ''; 169 170 if ( empty($aim) ) 171 $aim = ''; 172 173 if ( empty($yim) ) 174 $yim = ''; 175 167 176 if ( empty($user_registered) ) 168 177 $user_registered = gmdate('Y-m-d H:i:s'); -
trunk/wp-includes/rss.php
r9554 r9699 460 460 if ( $cache_status == 'STALE' ) { 461 461 $rss = $cache->get( $url ); 462 if ( $rss->etagand $rss->last_modified ) {462 if ( isset($rss->etag) and $rss->last_modified ) { 463 463 $request_headers['If-None-Match'] = $rss->etag; 464 464 $request_headers['If-Last-Modified'] = $rss->last_modified; … … 565 565 566 566 // if RSS parsed successfully 567 if ( $rss && !$rss->ERROR) {567 if ( $rss && (!isset($rss->ERROR) || !$rss->ERROR) ) { 568 568 569 569 // find Etag, and Last-Modified -
trunk/wp-login.php
r9025 r9699 295 295 } 296 296 297 if ( 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.'));297 if ( isset($_GET['error']) && 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.')); 298 298 299 299 do_action('lost_password'); 300 300 login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or e-mail address. You will receive a new password via e-mail.') . '</p>', $errors); 301 302 $user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : ''; 303 301 304 ?> 302 305 … … 304 307 <p> 305 308 <label><?php _e('Username or E-mail:') ?><br /> 306 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape( stripslashes($_POST['user_login'])); ?>" size="20" tabindex="10" /></label>309 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape($user_login); ?>" size="20" tabindex="10" /></label> 307 310 </p> 308 311 <?php do_action('lostpassword_form'); ?>
Note: See TracChangeset
for help on using the changeset viewer.