Changeset 8589
- Timestamp:
- 08/08/2008 05:05:10 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r8577 r8589 1 1 <?php 2 3 if ( ! isset( $post_ID ) ) 4 $post_ID = 0; 2 5 3 6 $action = isset($action) ? $action : ''; 4 7 if ( isset($_GET['message']) ) 5 8 $_GET['message'] = absint( $_GET['message'] ); 6 $messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer']) ) );9 $messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) ); 7 10 $messages[2] = __('Custom field updated.'); 8 11 $messages[3] = __('Custom field deleted.'); … … 15 18 $notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' ); 16 19 17 if ( !isset($post_ID) ||0 == $post_ID ) {20 if ( 0 == $post_ID ) { 18 21 $form_action = 'post'; 19 22 $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() … … 55 58 <?php 56 59 57 if ( !isset($post_ID) ||0 == $post_ID)60 if ( 0 == $post_ID) 58 61 wp_nonce_field('add-post'); 59 62 else … … 124 127 <?php endif; ?> 125 128 <?php 126 if ( $post_ID) {129 if ( 0 != $post_ID ) { 127 130 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 128 131 $stamp = __('Scheduled for:<br />%1$s at %2$s'); … … 168 171 ?> 169 172 <br class="clear" /> 170 <?php if ( $post_ID): ?>173 <?php if ( 0 != $post_ID ): ?> 171 174 <?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { 172 175 $last_user = get_userdata($last_id); … … 186 189 187 190 <ul> 188 <?php if ( $post_ID): ?>191 <?php if ( 0 != $post_ID ): ?> 189 192 <li><a href="edit.php?p=<?php echo $post_ID ?>"><?php _e('See Comments on this Post') ?></a></li> 190 193 <?php endif; ?> … … 346 349 function post_password_meta_box($post) { 347 350 ?> 348 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>351 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php if ( isset( $post->post_password ) ) : echo attribute_escape( $post->post_password ); endif; ?>" /></p> 349 352 <p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p> 350 353 <?php … … 375 378 endif; 376 379 377 if ( isset($post_ID) &&0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :380 if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : 378 381 function post_revisions_meta_box($post) { 379 382 wp_list_post_revisions(); -
trunk/wp-admin/edit-link-form.php
r8025 r8589 15 15 global $link; 16 16 17 $link_rel = $link->link_rel;17 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; 18 18 $rels = preg_split('/\s+/', $link_rel); 19 19 … … 93 93 <h3><label for="link_description"><?php _e('Description') ?></label></h3> 94 94 <div class="inside"> 95 <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo $link->link_description; ?>" id="link_description" /><br />95 <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo ( isset( $link->link_description ) ? $link->link_description : ''); ?>" id="link_description" /><br /> 96 96 <?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?> 97 97 </div> … … 117 117 <div id="categories-all" class="ui-tabs-panel"> 118 118 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> 119 <?php wp_link_category_checklist($link->link_id); ?> 119 <?php 120 if ( isset($link->link_id) ) 121 wp_link_category_checklist($link->link_id); 122 else 123 wp_link_category_checklist(); 124 ?> 120 125 </ul> 121 126 </div> … … 138 143 <fieldset><legend class="hidden"><?php _e('Target') ?></legend> 139 144 <label for="link_target_blank" class="selectit"> 140 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo (($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />145 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> /> 141 146 <code>_blank</code></label><br /> 142 147 <label for="link_target_top" class="selectit"> 143 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo (($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />148 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> /> 144 149 <code>_top</code></label><br /> 145 150 <label for="link_target_none" class="selectit"> 146 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo (($link->link_target == '') ? 'checked="checked"' : ''); ?> />151 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> /> 147 152 <?php _e('none') ?></label> 148 153 </fieldset> … … 157 162 <tr> 158 163 <th style="width: 20%;" scope="row"><label for="link_rel"><?php _e('rel:') ?></label></th> 159 <td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>164 <td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? $link->link_rel : ''); ?>" /></td> 160 165 </tr> 161 166 <tr> … … 270 275 <tr class="form-field"> 271 276 <th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th> 272 <td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>277 <td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? $link->link_image : ''); ?>" style="width: 95%" /></td> 273 278 </tr> 274 279 <tr class="form-field"> 275 280 <th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th> 276 <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>281 <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? $link->link_rss : ''); ?>" size="50" style="width: 95%" /></td> 277 282 </tr> 278 283 <tr class="form-field"> 279 284 <th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th> 280 <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>285 <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td> 281 286 </tr> 282 287 <tr class="form-field"> … … 286 291 for ($r = 0; $r < 10; $r++) { 287 292 echo(' <option value="'.$r.'" '); 288 if ( $link->link_rating == $r)293 if ( isset($link->link_rating) && $link->link_rating == $r) 289 294 echo 'selected="selected"'; 290 295 echo('>'.$r.'</option>'); -
trunk/wp-admin/edit-page-form.php
r8530 r8589 1 1 <?php 2 3 if ( ! isset( $post_ID ) ) 4 $post_ID = 0; 5 2 6 if ( isset($_GET['message']) ) 3 7 $_GET['message'] = absint( $_GET['message'] ); 4 $messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer']) ) );8 $messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) ); 5 9 $messages[2] = __('Custom field updated.'); 6 10 $messages[3] = __('Custom field deleted.'); … … 13 17 $notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' ); 14 18 15 if ( !isset($post_ID) ||0 == $post_ID) {19 if ( 0 == $post_ID) { 16 20 $form_action = 'post'; 17 21 $nonce_action = 'add-page'; … … 103 107 104 108 <?php 105 if ( $post_ID) {109 if ( 0 != $post_ID ) { 106 110 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 107 111 $stamp = __('Scheduled for:<br />%1$s at %2$s'); … … 145 149 ?> 146 150 <br class="clear" /> 147 <?php if ( $post_ID): ?>151 <?php if ( 0 != $post_ID ) : ?> 148 152 <?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { 149 153 $last_user = get_userdata($last_id); … … 163 167 164 168 <ul> 165 <?php if ( $post_ID): ?>169 <?php if ( 0 != $post_ID ) : ?> 166 170 <li><a href="edit-pages.php?page_id=<?php echo $post_ID ?>"><?php _e('See Comments on this Page') ?></a></li> 167 171 <?php endif; ?> … … 241 245 function page_password_meta_box($post){ 242 246 ?> 243 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password); ?>" /></p>247 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo ( isset( $post->post_password ) ? attribute_escape( $post->post_password ) : '' ); ?>" /></p> 244 248 <p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p> 245 249 <?php … … 305 309 306 310 307 if ( isset($post_ID) &&0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :311 if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : 308 312 function page_revisions_meta_box($post) { 309 313 wp_list_post_revisions(); -
trunk/wp-admin/edit-pages.php
r8484 r8589 90 90 continue; 91 91 92 if ( $status == $_GET['post_status'] )92 if ( isset( $_GET['post_status'] ) && $status == $_GET['post_status'] ) 93 93 $class = ' class="current"'; 94 94 … … 120 120 121 121 <?php 122 $pagenum = absint( $_GET['pagenum'] );122 $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0; 123 123 if ( empty($pagenum) ) 124 124 $pagenum = 1; 125 if( ! $per_page|| $per_page < 0 )125 if( ! isset( $per_page ) || $per_page < 0 ) 126 126 $per_page = 20; 127 127 -
trunk/wp-admin/includes/media.php
r8416 r8589 296 296 297 297 function media_upload_image() { 298 $errors = array(); 299 $id = 0; 300 298 301 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 299 302 // Upload File button was clicked … … 360 363 361 364 function media_upload_audio() { 365 $errors = array(); 366 $id = 0; 367 362 368 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 363 369 // Upload File button was clicked … … 400 406 401 407 function media_upload_video() { 408 $errors = array(); 409 $id = 0; 410 402 411 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 403 412 // Upload File button was clicked … … 440 449 441 450 function media_upload_file() { 451 $errors = array(); 452 $id = 0; 453 442 454 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 443 455 // Upload File button was clicked … … 480 492 481 493 function media_upload_gallery() { 494 $errors = array(); 495 482 496 if ( !empty($_POST) ) { 483 497 $return = media_upload_form_handler(); … … 494 508 495 509 function media_upload_library() { 510 $errors = array(); 496 511 if ( !empty($_POST) ) { 497 512 $return = media_upload_form_handler(); … … 1128 1143 $form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id"); 1129 1144 1130 $_GET['paged'] = i ntval($_GET['paged']);1145 $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0; 1131 1146 if ( $_GET['paged'] < 1 ) 1132 1147 $_GET['paged'] = 1; -
trunk/wp-admin/includes/post.php
r8577 r8589 538 538 if ( false === $q ) 539 539 $q = $_GET; 540 $q['m'] = (int) $q['m']; 541 $q['cat'] = (int) $q['cat']; 540 541 $q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0; 542 $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0; 542 543 $q['post_type'] = 'attachment'; 543 544 $q['post_status'] = 'any'; -
trunk/wp-admin/includes/template.php
r8484 r8589 264 264 265 265 function wp_link_category_checklist( $link_id = 0 ) { 266 $default = 1; 267 266 268 if ( $link_id ) { 267 269 $checked_categories = wp_get_link_cats($link_id); … … 379 381 $posts_columns = array(); 380 382 $posts_columns['cb'] = '<input type="checkbox" />'; 381 if ( 'draft' === $_GET['post_status'] ) 382 $posts_columns['modified'] = __('Modified'); 383 elseif ( 'pending' === $_GET['post_status'] ) 384 $posts_columns['modified'] = __('Submitted'); 385 else 386 $posts_columns['date'] = __('Date'); 383 384 $post_status = isset( $_GET['post_status'] ) ? $_GET['post_status'] : ''; 385 386 switch( $post_status ) { 387 case 'draft': 388 $posts_columns['modified'] = __('Modified'); 389 break; 390 case 'pending': 391 $posts_columns['modified'] = __('Submitted'); 392 break; 393 default: 394 $posts_columns['date'] = __('Date'); 395 } 396 387 397 $posts_columns['title'] = __('Title'); 388 398 $posts_columns['author'] = __('Author'); 389 if ( !in_array($ _GET['post_status'], array('pending', 'draft', 'future')) )399 if ( !in_array($post_status, array('pending', 'draft', 'future')) ) 390 400 $posts_columns['comments'] = '<div class="vers"><img alt="" src="images/comment-grey-bubble.png" /></div>'; 391 401 $posts_columns['status'] = __('Status'); … … 1211 1221 1212 1222 foreach ( array('high', 'core', 'default', 'low') as $priority ) { 1223 if ( ! isset( $wp_meta_boxes[$page][$context][$priority] ) ) 1224 continue; 1225 1213 1226 foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { 1214 1227 if ( false === $box ) -
trunk/wp-admin/includes/theme.php
r8051 r8589 36 36 $template_data = implode( '', file( WP_CONTENT_DIR.$template )); 37 37 38 preg_match( '|Template Name:(.*)$|mi', $template_data, $name ); 39 preg_match( '|Description:(.*)$|mi', $template_data, $description ); 38 $name = ''; 39 if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) ) 40 $name = $name[1]; 40 41 41 $name = $name[1]; 42 $description = $description[1]; 42 $description = ''; 43 if( preg_match( '|Description:(.*)$|mi', $template_data, $description ) ) 44 $description = $description[1]; 43 45 44 46 if ( !empty( $name ) ) { -
trunk/wp-admin/includes/update.php
r8540 r8589 8 8 9 9 $cur = get_option( 'update_core' ); 10 if ( ! isset( $cur->current ) ) 11 $cur->current = ''; 12 13 if ( ! isset( $cur->url ) ) 14 $cur->url = ''; 10 15 11 16 switch ( $cur->response ) { -
trunk/wp-admin/link-add.php
r7961 r8589 18 18 ?> 19 19 20 <?php if ( $_GET['added']&& '' != $_POST['link_name']) : ?>20 <?php if ( isset( $_GET['added'] ) && '' != $_POST['link_name']) : ?> 21 21 <div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div> 22 22 <?php endif; ?> -
trunk/wp-admin/link-manager.php
r7883 r8589 80 80 <p id="post-search"> 81 81 <label class="hidden" for="post-search-input"><?php _e( 'Search Links' ); ?>:</label> 82 <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />82 <input type="text" id="post-search-input" name="s" value="<?php echo ( isset( $_GET['s'] ) ? attribute_escape(stripslashes($_GET['s'])) : ''); ?>" /> 83 83 <input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" /> 84 84 </p> … … 151 151 <tbody> 152 152 <?php 153 $i = 0; // It is slower incrementing an undefined and valueless variable. 154 153 155 foreach ($links as $link) { 154 156 $link = sanitize_bookmark($link); -
trunk/wp-admin/menu.php
r8540 r8589 28 28 29 29 $update_plugins = get_option( 'update_plugins' ); 30 $update_count = count( $update_plugins->response ); 30 $update_count = 0; 31 if ( isset( $update_plugins->response ) ) 32 $update_count = count( $update_plugins->response ); 33 31 34 $menu[35] = array( sprintf( __('Plugins %s'), "<span id='update-plugins' class='count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php'); 32 35 if ( current_user_can('edit_users') ) -
trunk/wp-includes/canonical.php
r7990 r8589 184 184 $redirect['host'] = $original['host']; 185 185 186 if ( array($original['host'], $original['port'], $original['path'], $original['query']) !== array($redirect['host'], $redirect['port'], $redirect['path'], $redirect['query']) ) { 186 $compare_original = array($original['host'], $original['path']); 187 188 if ( isset( $original['port'] ) ) 189 $compare_original[] = $original['port']; 190 191 if ( isset( $original['query'] ) ) 192 $compare_original[] = $original['query']; 193 194 $compare_redirect = array($redirect['host'], $redirect['path']); 195 196 if ( isset( $redirect['port'] ) ) 197 $compare_redirect[] = $redirect['port']; 198 199 if ( isset( $redirect['query'] ) ) 200 $compare_redirect[] = $redirect['query']; 201 202 if ( $compare_original !== $compare_redirect ) { 187 203 $redirect_url = $redirect['scheme'] . '://' . $redirect['host']; 188 204 if ( isset($redirect['port']) ) -
trunk/wp-includes/formatting.php
r8540 r8589 28 28 $curl = $textarr[$i]; 29 29 30 if ( isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag30 if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag 31 31 // static strings 32 32 $curl = str_replace($static_characters, $static_replacements, $curl); -
trunk/wp-includes/functions.php
r8572 r8589 1412 1412 1413 1413 function wp_get_referer() { 1414 $ref = ''; 1414 1415 if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) 1415 1416 $ref = $_REQUEST['_wp_http_referer']; -
trunk/wp-includes/query.php
r8572 r8589 473 473 , 'category_name' 474 474 , 'tag' 475 , 'cat' 475 476 , 'tag_id' 476 477 , 'author_name'
Note: See TracChangeset
for help on using the changeset viewer.