Changeset 6983
- Timestamp:
- 02/22/2008 05:43:56 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
wp-admin/admin-ajax.php (modified) (3 diffs)
-
wp-admin/edit-form-advanced.php (modified) (3 diffs)
-
wp-admin/edit-page-form.php (modified) (1 diff)
-
wp-admin/includes/dashboard.php (modified) (1 diff)
-
wp-admin/includes/post.php (modified) (8 diffs)
-
wp-admin/includes/taxonomy.php (modified) (1 diff)
-
wp-admin/media-upload.php (modified) (1 diff)
-
wp-admin/post.php (modified) (1 diff)
-
wp-includes/canonical.php (modified) (1 diff)
-
wp-includes/functions.php (modified) (1 diff)
-
wp-includes/post.php (modified) (3 diffs)
-
wp-includes/query.php (modified) (1 diff)
-
wp-includes/taxonomy.php (modified) (3 diffs)
-
wp-includes/widgets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r6954 r6983 8 8 die('-1'); 9 9 10 if ( 'ajax-tag-search' == $_GET['action'] ) {10 if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) { 11 11 if ( !current_user_can( 'manage_categories' ) ) 12 12 die('-1'); … … 21 21 } 22 22 23 $id = (int) $_POST['id'];23 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 24 24 switch ( $action = $_POST['action'] ) : 25 25 case 'add-post' : … … 166 166 if ( 0 > $parent = (int) $_POST['newcat_parent'] ) 167 167 $parent = 0; 168 169 $checked_categories = array_map( 'absint', (array) $ _POST['post_category']);168 $post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array(); 169 $checked_categories = array_map( 'absint', (array) $post_category ); 170 170 171 171 $x = new WP_Ajax_Response(); -
trunk/wp-admin/edit-form-advanced.php
r6969 r6983 1 1 <?php 2 $action = isset($action)? $action : ''; 2 3 if ( isset($_GET['message']) ) 3 4 $_GET['message'] = (int) $_GET['message']; … … 19 20 <?php 20 21 21 if ( 0 == $post_ID) {22 if (!isset($post_ID) || 0 == $post_ID) { 22 23 $form_action = 'post'; 23 24 $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() … … 137 138 } 138 139 139 if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )140 if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) ) 140 141 echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$post_ID", 'delete-post_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete post') . "</a>"; 141 142 ?> -
trunk/wp-admin/edit-page-form.php
r6969 r6983 1 1 <?php 2 2 3 if ( 0 == $post_ID) {3 if (!isset($post_ID) || 0 == $post_ID) { 4 4 $form_action = 'post'; 5 5 $nonce_action = 'add-page'; -
trunk/wp-admin/includes/dashboard.php
r6958 r6983 171 171 global $wp_registered_widgets, $wp_registered_widget_controls; 172 172 173 $sidebar_defaults = array('widget_id' => 0, 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => ''); 174 extract( $sidebar_defaults, EXTR_PREFIX_ALL, 'sidebar' ); 173 175 extract( $params[0], EXTR_PREFIX_ALL, 'sidebar' ); 176 177 if ( !isset($wp_registered_widgets[$sidebar_widget_id]) || !is_array($wp_registered_widgets[$sidebar_widget_id]) ) { 178 return $params; 179 } 180 $widget_defaults = array('id' => '', 'width' => '', 'height' => '', 'class' => '', 'feed_link' => '', 'all_link' => '', 'notice' => false, 'error' => false); 181 extract( $widget_defaults, EXTR_PREFIX_ALL, 'widget' ); 174 182 extract( $wp_registered_widgets[$sidebar_widget_id], EXTR_PREFIX_ALL, 'widget' ); 175 183 -
trunk/wp-admin/includes/post.php
r6955 r6983 29 29 $_POST['post_content'] = $_POST['content']; 30 30 $_POST['post_excerpt'] = $_POST['excerpt']; 31 $_POST['post_parent'] = $_POST['parent_id'];31 $_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : ''; 32 32 $_POST['to_ping'] = $_POST['trackback_url']; 33 33 … … 53 53 54 54 // What to do based on which button they pressed 55 if ( '' != $_POST['saveasdraft'] )55 if ( isset($_POST['saveasdraft']) && '' != $_POST['saveasdraft'] ) 56 56 $_POST['post_status'] = 'draft'; 57 if ( '' != $_POST['saveasprivate'] )57 if ( isset($_POST['saveasprivate']) && '' != $_POST['saveasprivate'] ) 58 58 $_POST['post_status'] = 'private'; 59 if ( ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) )59 if ( isset($_POST['publish']) && ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) ) 60 60 $_POST['post_status'] = 'publish'; 61 if ( '' != $_POST['advanced'] )61 if ( isset($_POST['advanced']) && '' != $_POST['advanced'] ) 62 62 $_POST['post_status'] = 'draft'; 63 63 … … 92 92 93 93 // Meta Stuff 94 if ( $_POST['meta'] ) {94 if ( isset($_POST['meta']) && $_POST['meta'] ) { 95 95 foreach ( $_POST['meta'] as $key => $value ) 96 96 update_meta( $key, $value['key'], $value['value'] ); 97 97 } 98 98 99 if ( $_POST['deletemeta'] ) {99 if ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) { 100 100 foreach ( $_POST['deletemeta'] as $key => $value ) 101 101 delete_meta( $key ); … … 129 129 } 130 130 131 $post_content = ''; 131 132 if ( !empty( $_REQUEST['content'] ) ) 132 133 $post_content = wp_specialchars( stripslashes( $_REQUEST['content'] )); … … 143 144 $post_excerpt = ''; 144 145 146 $post->ID = 0; 147 $post->post_name = ''; 148 $post->post_author = ''; 149 $post->post_date = ''; 145 150 $post->post_status = 'draft'; 146 151 $post->post_type = 'post'; 152 $post->to_ping = ''; 153 $post->pinged = ''; 147 154 $post->comment_status = get_option( 'default_comment_status' ); 148 155 $post->ping_status = get_option( 'default_ping_status' ); … … 225 232 $_POST['post_content'] = $_POST['content']; 226 233 $_POST['post_excerpt'] = $_POST['excerpt']; 227 $_POST['post_parent'] = $_POST['parent_id'];234 $_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : ''; 228 235 $_POST['to_ping'] = $_POST['trackback_url']; 229 236 … … 251 258 252 259 // What to do based on which button they pressed 253 if ( '' != $_POST['saveasdraft'] )260 if ( isset($_POST['saveasdraft']) && '' != $_POST['saveasdraft'] ) 254 261 $_POST['post_status'] = 'draft'; 255 if ( '' != $_POST['saveasprivate'] )262 if ( isset($_POST['saveasprivate']) && '' != $_POST['saveasprivate'] ) 256 263 $_POST['post_status'] = 'private'; 257 if ( ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) )264 if ( isset($_POST['publish']) && ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) ) 258 265 $_POST['post_status'] = 'publish'; 259 if ( '' != $_POST['advanced'] )266 if ( isset($_POST['advanced']) && '' != $_POST['advanced'] ) 260 267 $_POST['post_status'] = 'draft'; 261 268 … … 572 579 function get_sample_permalink($id, $name = null) { 573 580 $post = &get_post($id); 581 if (!$post->ID) { 582 return array('', ''); 583 } 574 584 $original_status = $post->post_status; 575 585 $original_date = $post->post_date; -
trunk/wp-admin/includes/taxonomy.php
r6588 r6983 52 52 53 53 function wp_insert_category($catarr, $wp_error = false) { 54 $cat_defaults = array('cat_ID' => 0, 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => ''); 54 55 extract($catarr, EXTR_SKIP); 55 56 -
trunk/wp-admin/media-upload.php
r6659 r6983 12 12 13 13 // IDs should be integers 14 $ID = (int) $ID;15 $post_id = (int) $post_id;14 $ID = isset($ID)? (int) $ID : 0; 15 $post_id = isset($post_id)? (int) $post_id : 0; 16 16 17 17 // Require an ID for the edit screen 18 if ( $action == 'edit' && !$ID )18 if ( isset($action) && $action == 'edit' && !$ID ) 19 19 wp_die(__("You are not allowed to be here")); 20 20 -
trunk/wp-admin/post.php
r6894 r6983 128 128 $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer()); 129 129 130 if ( $_POST['addmeta']) {130 if (isset($_POST['addmeta']) && $_POST['addmeta']) { 131 131 $location = add_query_arg( 'message', 2, wp_get_referer() ); 132 132 $location = explode('#', $location); 133 133 $location = $location[0] . '#postcustom'; 134 } elseif ( $_POST['deletemeta']) {134 } elseif (isset($_POST['deletemeta']) && $_POST['deletemeta']) { 135 135 $location = add_query_arg( 'message', 3, wp_get_referer() ); 136 136 $location = explode('#', $location); -
trunk/wp-includes/canonical.php
r6743 r6983 179 179 $redirect['host'] = $original['host']; 180 180 181 // prevent notices in the comparison below 182 $original['query'] = isset($redirect['query'])? $redirect['query'] : false; 183 $original['port'] = isset($redirect['port'])? $redirect['port'] : false; 184 $redirect['query'] = isset($redirect['query'])? $redirect['query'] : false; 185 $redirect['port'] = isset($redirect['port'])? $redirect['port'] : false; 186 181 187 if ( array($original['host'], $original['port'], $original['path'], $original['query']) !== array($redirect['host'], $redirect['port'], $redirect['path'], $redirect['query']) ) { 182 188 $redirect_url = $redirect['scheme'] . '://' . $redirect['host']; -
trunk/wp-includes/functions.php
r6817 r6983 376 376 // expected_slashed ($name) 377 377 $option = $wpdb->get_row( "SELECT option_id, autoload FROM $wpdb->options WHERE option_name = '$name'" ); 378 if ( !$option->option_id )378 if ( is_null($option) || !$option->option_id ) 379 379 return false; 380 380 // expected_slashed ($name) -
trunk/wp-includes/post.php
r6974 r6983 181 181 return $_post; 182 182 } elseif ( $output == ARRAY_A ) { 183 return get_object_vars($_post); 183 $__post = get_object_vars($_post); 184 return $__post; 184 185 } elseif ( $output == ARRAY_N ) { 185 return array_values(get_object_vars($_post)); 186 $__post = array_values(get_object_vars($_post)); 187 return $__post; 186 188 } else { 187 189 return $_post; … … 699 701 if ( 'raw' == $context ) 700 702 return $post; 701 702 if ( is_object($post) ) 703 if ( is_object($post) ) { 704 if ( !isset($post->ID) ) 705 return $post; 703 706 foreach ( array_keys(get_object_vars($post)) as $field ) 704 707 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 705 else 708 } else { 709 if ( !isset($post['ID']) ) 710 return $post; 706 711 foreach ( array_keys($post) as $field ) 707 712 $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); 708 713 } 709 714 return $post; 710 715 } … … 2367 2372 */ 2368 2373 function wp_check_for_changed_slugs($post_id) { 2369 if ( ! strlen($_POST['wp-old-slug']) )2374 if ( !isset($_POST['wp-old-slug']) || !strlen($_POST['wp-old-slug']) ) 2370 2375 return $post_id; 2371 2376 -
trunk/wp-includes/query.php
r6910 r6983 1155 1155 // MIME-Type stuff for attachment browsing 1156 1156 1157 if ( '' != $q['post_mime_type'] )1157 if ( isset($q['post_mime_type']) && '' != $q['post_mime_type'] ) 1158 1158 $whichmimetype = wp_post_mime_type_where($q['post_mime_type']); 1159 1159 -
trunk/wp-includes/taxonomy.php
r6851 r6983 641 641 } 642 642 643 $select_this = ''; 643 644 if ( 'all' == $fields ) 644 645 $select_this = 't.*, tt.*'; … … 1042 1043 $object_ids = implode(', ', $object_ids); 1043 1044 1045 $select_this = ''; 1044 1046 if ( 'all' == $fields ) 1045 1047 $select_this = 't.*, tt.*'; … … 1253 1255 1254 1256 $t = get_taxonomy($taxonomy); 1255 if ( ! $append && $t->sort ) {1257 if ( ! $append && isset($t->sort) && $t->sort ) { 1256 1258 $values = array(); 1257 1259 $term_order = 0; -
trunk/wp-includes/widgets.php
r6861 r6983 260 260 if ( is_array($sidebars_widgets) ) foreach ( $sidebars_widgets as $sidebar => $widgets ) 261 261 if ( is_array($widgets) ) foreach ( $widgets as $widget ) 262 if ( $wp_registered_widgets[$widget]['callback'] == $callback )262 if ( isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) 263 263 return $sidebar; 264 264
Note: See TracChangeset
for help on using the changeset viewer.