Changeset 8646
- Timestamp:
- 08/14/2008 05:00:37 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit.php
r8484 r8646 57 57 if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) 58 58 $post_status_label = $post_stati[$_GET['post_status']][1]; 59 if ( $post_listing_pageable && !is_archive() && !is_search() )60 $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label);61 else59 //if ( $post_listing_pageable && !is_archive() && !is_search() ) //Unreachable code: $post_listing_pageable is undefined, Similar code in upload.php 60 // $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label); 61 //else 62 62 $h2_noun = $post_status_label; 63 63 // Use $_GET instead of is_ since they can override each other 64 64 $h2_author = ''; 65 $_GET['author'] = (int) $_GET['author'];65 $_GET['author'] = isset($_GET['author']) ? (int) $_GET['author'] : 0; 66 66 if ( $_GET['author'] != 0 ) { 67 67 if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion … … 94 94 if ( empty( $num_posts->$status ) ) 95 95 continue; 96 if ( $status == $_GET['post_status'] )96 if ( isset($_GET['post_status']) && $status == $_GET['post_status'] ) 97 97 $class = ' class="current"'; 98 98 … … 147 147 $month_count = count($arc_result); 148 148 149 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?> 149 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { 150 $m = isset($_GET['m']) ? (int)$_GET['m'] : 0; 151 ?> 150 152 <select name='m'> 151 <option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>153 <option<?php selected( $m, 0 ); ?> value='0'><?php _e('Show all dates'); ?></option> 152 154 <?php 153 155 foreach ($arc_result as $arc_row) { … … 156 158 $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 ); 157 159 158 if ( $arc_row->yyear . $arc_row->mmonth == $ _GET['m'])160 if ( $arc_row->yyear . $arc_row->mmonth == $m ) 159 161 $default = ' selected="selected"'; 160 162 else -
trunk/wp-admin/includes/post.php
r8600 r8646 491 491 if ( false === $q ) 492 492 $q = $_GET; 493 $q['m'] = (int) $q['m'];494 $q['cat'] = (int) $q['cat'];493 $q['m'] = isset($q['m']) ? (int) $q['m'] : 0; 494 $q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0; 495 495 $post_stati = array( // array( adj, noun ) 496 496 'publish' => array(__('Published'), __('Published posts'), __ngettext_noop('Published (%s)', 'Published (%s)')), … … 511 511 } 512 512 513 if ( 'pending' === $q['post_status'] ) {513 if ( isset($q['post_status']) && 'pending' === $q['post_status'] ) { 514 514 $order = 'ASC'; 515 515 $orderby = 'modified'; 516 } elseif ( 'draft' === $q['post_status'] ) {516 } elseif ( isset($q['post_status']) && 'draft' === $q['post_status'] ) { 517 517 $order = 'DESC'; 518 518 $orderby = 'modified'; -
trunk/wp-admin/includes/template.php
r8600 r8646 344 344 $posts_columns = array(); 345 345 $posts_columns['cb'] = '<input type="checkbox" />'; 346 if ( 'draft' === $_GET['post_status'] )346 if ( isset($_GET['post_status']) && 'draft' === $_GET['post_status'] ) 347 347 $posts_columns['modified'] = __('Modified'); 348 elseif ( 'pending' === $_GET['post_status'] )348 elseif ( isset($_GET['post_status']) && 'pending' === $_GET['post_status'] ) 349 349 $posts_columns['modified'] = __('Submitted'); 350 350 else … … 354 354 $posts_columns['categories'] = __('Categories'); 355 355 $posts_columns['tags'] = __('Tags'); 356 if ( !i n_array($_GET['post_status'], array('pending', 'draft', 'future')) )356 if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) 357 357 $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 358 358 $posts_columns['status'] = __('Status'); … … 1093 1093 function wp_dropdown_roles( $default = false ) { 1094 1094 global $wp_roles; 1095 $p = ''; 1095 1096 $r = ''; 1096 1097 foreach( $wp_roles->role_names as $role => $name ) { -
trunk/wp-admin/includes/theme.php
r8589 r8646 45 45 46 46 if ( !empty( $name ) ) { 47 $page_templates[trim( $name )] = basename( $template );47 $page_templates[trim( $name )] = theme_basename( $template ); 48 48 } 49 49 } -
trunk/wp-admin/includes/user.php
r8467 r8646 302 302 var $too_many_total_users = false; 303 303 var $search_errors; 304 var $paging_text; 304 305 305 306 function WP_User_Search ($search_term = '', $page = '', $role = '') { // constructor -
trunk/wp-admin/plugins.php
r8600 r8646 13 13 $action = $_GET['action']; 14 14 15 $plugin = $_REQUEST['plugin'];15 $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : ''; 16 16 17 17 if( !empty($action) ) { -
trunk/wp-admin/users.php
r7998 r8646 9 9 $parent_file = 'users.php'; 10 10 11 $action = $_REQUEST['action'];11 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; 12 12 $update = ''; 13 13 … … 26 26 } else { 27 27 $redirect = 'users.php'; 28 $referer = ''; 28 29 } 29 30 … … 193 194 include('admin-header.php'); 194 195 196 $usersearch = isset($_GET['usersearch']) ? $_GET['usersearch'] : null; 197 $userspage = isset($_GET['userspage']) ? $_GET['userspage'] : null; 198 $role = isset($_GET['role']) ? $_GET['role'] : null; 199 195 200 // Query the users 196 $wp_user_search = new WP_User_Search($ _GET['usersearch'], $_GET['userspage'], $_GET['role']);201 $wp_user_search = new WP_User_Search($usersearch, $userspage, $role); 197 202 198 203 if ( isset($_GET['update']) ) : … … 201 206 case 'del_many': 202 207 ?> 203 <?php $delete_count = (int) $_GET['delete_count']; ?>208 <?php $delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0; ?> 204 209 <div id="message" class="updated fade"><p><?php printf(__ngettext('%s user deleted', '%s users deleted', $delete_count), $delete_count); ?></p></div> 205 210 <?php … … 230 235 endif; ?> 231 236 232 <?php if ( is _wp_error( $errors ) ) : ?>237 <?php if ( isset($errors) && is_wp_error( $errors ) ) : ?> 233 238 <div class="error"> 234 239 <ul> … … 266 271 267 272 $current_role = false; 268 $class = empty($ _GET['role']) ? ' class="current"' : '';273 $class = empty($role) ? ' class="current"' : ''; 269 274 $role_links[] = "<li><a href=\"users.php\"$class>" . __('All Users') . "</a>"; 270 foreach ( $wp_roles->get_names() as $ role => $name ) {275 foreach ( $wp_roles->get_names() as $this_role => $name ) { 271 276 if ( !isset($avail_roles[$role]) ) 272 277 continue; … … 274 279 $class = ''; 275 280 276 if ( $ role == $_GET['role']) {277 $current_role = $ _GET['role'];281 if ( $this_role == $role ) { 282 $current_role = $role; 278 283 $class = ' class="current"'; 279 284 } 280 285 281 286 $name = translate_with_context($name); 282 $name = sprintf(_c('%1$s (%2$s)|user role with count'), $name, $avail_roles[$ role]);283 $role_links[] = "<li><a href=\"users.php?role=$ role\"$class>" . $name . '</a>';287 $name = sprintf(_c('%1$s (%2$s)|user role with count'), $name, $avail_roles[$this_role]); 288 $role_links[] = "<li><a href=\"users.php?role=$this_role\"$class>" . $name . '</a>'; 284 289 } 285 290 echo implode(' |</li>', $role_links) . '</li>'; … … 370 375 371 376 <?php 372 if ( is_wp_error($add_user_errors) ) { 373 foreach ( array('user_login' => 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) { 374 $var = 'new_' . $var; 375 $$var = attribute_escape(stripslashes($_REQUEST[$formpost])); 376 } 377 unset($name); 378 } 377 foreach ( array('user_login' => 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) { 378 $var = 'new_' . $var; 379 $$var = isset($_REQUEST[$formpost]) ? attribute_escape(stripslashes($_REQUEST[$formpost])) : ''; 380 } 381 unset($name); 379 382 ?> 380 383 … … 385 388 <h2 id="add-new-user"><?php _e('Add New User') ?></h2> 386 389 387 <?php if ( is _wp_error( $add_user_errors ) ) : ?>390 <?php if ( isset($add_user_errors) && is_wp_error( $add_user_errors ) ) : ?> 388 391 <div class="error"> 389 392 <?php -
trunk/wp-includes/capabilities.php
r8573 r8646 138 138 var $roles = array(); 139 139 var $allcaps = array(); 140 141 var $first_name = ''; 142 var $last_name = ''; 140 143 141 144 function WP_User( $id, $name = '' ) { -
trunk/wp-includes/classes.php
r8600 r8646 111 111 112 112 // Substitute the substring matches into the query. 113 eval("\$query = \"" . addslashes($query) . "\";"); 113 eval("@\$query = \"" . addslashes($query) . "\";"); 114 114 115 $this->matched_query = $query; 115 116 -
trunk/wp-includes/post.php
r8637 r8646 1936 1936 $leaf_path = sanitize_title(basename($page_paths)); 1937 1937 $page_paths = explode('/', $page_paths); 1938 $full_path = ''; 1938 1939 foreach( (array) $page_paths as $pathdir) 1939 1940 $full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir); -
trunk/wp-includes/query.php
r8637 r8646 687 687 $this->is_tax = false; 688 688 foreach ( $GLOBALS['wp_taxonomies'] as $t ) { 689 if ( isset($t->query_var) && '' != $qv[$t->query_var] ) {689 if ( isset($t->query_var) && isset($qv[$t->query_var]) && '' != $qv[$t->query_var] ) { 690 690 $this->is_tax = true; 691 691 break; -
trunk/wp-includes/taxonomy.php
r8600 r8646 298 298 global $wpdb; 299 299 300 if ( empty($term) ) 301 return null; 302 303 if ( ! is_taxonomy($taxonomy) ) 304 return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); 300 if ( empty($term) ) { 301 $error = new WP_Error('invalid_term', __('Empty Term')); 302 return $error; 303 } 304 305 if ( ! is_taxonomy($taxonomy) ) { 306 $error = new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); 307 return $error; 308 } 305 309 306 310 if ( is_object($term) ) {
Note: See TracChangeset
for help on using the changeset viewer.