Changeset 8732
- Timestamp:
- 08/25/2008 09:50:11 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r8726 r8732 14 14 if ( ! isset( $post_ID ) ) 15 15 $post_ID = 0; 16 else 17 $post_ID = (int) $post_ID; 16 18 17 19 $action = isset($action) ? $action : ''; … … 37 39 $autosave = false; 38 40 } else { 39 $post_ID = (int) $post_ID;40 41 $form_action = 'editpost'; 41 42 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 42 $autosave = wp_get_post_autosave( $post_ id);43 $autosave = wp_get_post_autosave( $post_ID ); 43 44 44 45 // Detect if there exists an autosave newer than the post and if that autosave is different than the post -
trunk/wp-admin/includes/post.php
r8691 r8732 18 18 $_POST['post_excerpt'] = $_POST['excerpt']; 19 19 $_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : ''; 20 $_POST['to_ping'] = $_POST['trackback_url']; 20 if ( isset($_POST['trackback_url']) ) 21 $_POST['to_ping'] = $_POST['trackback_url']; 21 22 22 23 if (!empty ( $_POST['post_author_override'] ) ) { … … 30 31 } 31 32 32 if ( $_POST['post_author'] != $_POST['user_ID']) {33 if ( isset($_POST['user_ID']) && ($_POST['post_author'] != $_POST['user_ID']) ) { 33 34 if ( 'page' == $_POST['post_type'] ) { 34 35 if ( !current_user_can( 'edit_others_pages' ) ) { … … 67 68 $_POST['post_status'] = 'pending'; 68 69 } else { 69 if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts') ) :70 if ( isset($_POST['post_status']) && ('publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' )) ) : 70 71 // Stop attempts to publish new posts, but allow already published posts to be saved if appropriate. 71 72 if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') ) -
trunk/wp-admin/includes/template.php
r8729 r8732 918 918 $edit = $user_object->user_login; 919 919 } 920 $role_name = $wp_roles->role_names[$role]? translate_with_context($wp_roles->role_names[$role]) : __('None');920 $role_name = isset($wp_roles->role_names[$role]) ? translate_with_context($wp_roles->role_names[$role]) : __('None'); 921 921 $r = "<tr id='user-$user_object->ID'$style> 922 922 <th scope='row' class='check-column'><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' /></th> … … 1531 1531 1532 1532 foreach ( array('high', 'sorted', 'core', 'default', 'low') as $priority ) { 1533 foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { 1534 if ( false == $box || ! $box['title'] ) 1535 continue; 1536 $i++; 1537 $style = ''; 1538 if ( in_array($box['id'], $hidden) ) 1539 $style = 'style="display:none;"'; 1540 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '" ' . $style . '>' . "\n"; 1541 echo "<h3><span class='hndle'>{$box['title']}</span></h3>\n"; 1542 echo '<div class="inside">' . "\n"; 1543 call_user_func($box['callback'], $object, $box); 1544 echo "</div>\n"; 1545 echo "</div>\n"; 1533 if ( isset($wp_meta_boxes[$page][$context][$priority]) ) { 1534 foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { 1535 if ( false == $box || ! $box['title'] ) 1536 continue; 1537 $i++; 1538 $style = ''; 1539 if ( in_array($box['id'], $hidden) ) 1540 $style = 'style="display:none;"'; 1541 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '" ' . $style . '>' . "\n"; 1542 echo "<h3><span class='hndle'>{$box['title']}</span></h3>\n"; 1543 echo '<div class="inside">' . "\n"; 1544 call_user_func($box['callback'], $object, $box); 1545 echo "</div>\n"; 1546 echo "</div>\n"; 1547 } 1546 1548 } 1547 1549 } -
trunk/wp-admin/revision.php
r8656 r8732 10 10 require_once('admin.php'); 11 11 12 wp_reset_vars(array('revision', 'left', 'right', ' action'));12 wp_reset_vars(array('revision', 'left', 'right', 'diff', 'action')); 13 13 $revision_id = absint($revision); 14 14 $diff = absint($diff); -
trunk/wp-includes/canonical.php
r8667 r8732 157 157 $redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] ); 158 158 159 // Remove trailing slashes from certain terminating query string args 160 $redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] ); 161 162 // Clean up empty query strings 163 $redirect['query'] = preg_replace( '#&?(p|page_id|cat|tag)=?$#', '', $redirect['query'] ); 159 if ( isset( $redirect['query'] ) ) { 160 // Remove trailing slashes from certain terminating query string args 161 $redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] ); 162 163 // Clean up empty query strings 164 $redirect['query'] = preg_replace( '#&?(p|page_id|cat|tag)=?$#', '', $redirect['query'] ); 165 } 164 166 165 167 // strip /index.php/ when we're not using PATHINFO permalinks -
trunk/wp-includes/post.php
r8702 r8732 124 124 125 125 $children = get_posts( $r ); 126 if ( !$children ) 127 return false; 126 if ( !$children ) { 127 $kids = false; 128 return $kids; 129 } 128 130 129 131 update_post_cache($children); … … 777 779 return $post; 778 780 if ( is_object($post) ) { 781 if ( !isset($post->ID) ) 782 $post->ID = 0; 779 783 foreach ( array_keys(get_object_vars($post)) as $field ) 780 784 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 781 785 } else { 786 if ( !isset($post['ID']) ) 787 $post['ID'] = 0; 782 788 foreach ( array_keys($post) as $field ) 783 789 $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); … … 1317 1323 1318 1324 // Make sure we set a valid category 1319 if ( 0 == count($post_category) || !is_array($post_category)) {1325 if ( empty($post_category) || 0 == count($post_category) || !is_array($post_category) ) { 1320 1326 $post_category = array(get_option('default_category')); 1321 1327 } … … 1329 1335 if ( empty($post_type) ) 1330 1336 $post_type = 'post'; 1337 1338 $post_ID = 0; 1331 1339 1332 1340 // Get the post ID and GUID … … 1433 1441 } 1434 1442 } else { 1435 $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update 1443 if ( isset($post_mime_type) ) 1444 $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update 1436 1445 if ( false === $wpdb->insert( $wpdb->posts, $data ) ) { 1437 1446 if ( $wp_error ) -
trunk/wp-includes/taxonomy.php
r8646 r8732 610 610 611 611 if ( $cache = wp_cache_get( 'get_terms', 'terms' ) ) { 612 if ( isset( $cache[ $key ] ) ) 613 return apply_filters('get_terms', $cache[$key], $taxonomies, $args); 612 if ( isset( $cache[ $key ] ) ) { 613 $terms = apply_filters('get_terms', $cache[$key], $taxonomies, $args); 614 return $terms; 615 } 614 616 } 615 617
Note: See TracChangeset
for help on using the changeset viewer.