Changeset 4229
- Timestamp:
- 09/25/2006 02:09:08 AM (19 years ago)
- Location:
- branches/2.0
- Files:
-
- 10 edited
-
wp-admin/admin-db.php (modified) (1 diff)
-
wp-admin/admin-functions.php (modified) (4 diffs)
-
wp-admin/edit-form-advanced.php (modified) (1 diff)
-
wp-admin/options-misc.php (modified) (1 diff)
-
wp-admin/options-permalink.php (modified) (2 diffs)
-
wp-admin/options.php (modified) (2 diffs)
-
wp-admin/profile.php (modified) (1 diff)
-
wp-admin/user-edit.php (modified) (1 diff)
-
wp-includes/default-filters.php (modified) (2 diffs)
-
wp-includes/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-admin/admin-db.php
r4032 r4229 267 267 268 268 $update = false; 269 269 270 if ( !empty($link_id) ) 270 271 $update = true; 271 272 273 if( trim( $link_name ) == '' ) 274 return 0; 275 $link_name = apply_filters('pre_link_name', $link_name); 276 277 if( trim( $link_url ) == '' ) 278 return 0; 279 $link_url = apply_filters('pre_link_url', $link_url); 280 272 281 if ( empty($link_rating) ) 273 282 $link_rating = 0; 283 else 284 $link_rating = (int) $link_rating; 285 286 if ( empty($link_image) ) 287 $link_image = ''; 288 $link_image = apply_filters('pre_link_image', $link_image); 274 289 275 290 if ( empty($link_target) ) 276 291 $link_target = ''; 292 $link_target = apply_filters('pre_link_target', $link_target); 277 293 278 294 if ( empty($link_visible) ) 279 295 $link_visible = 'Y'; 280 296 $link_visibile = preg_replace('/[^YNyn]/', '', $link_visible); 297 281 298 if ( empty($link_owner) ) 282 299 $link_owner = $current_user->id; 300 else 301 $link_owner = (int) $link_owner; 283 302 284 303 if ( empty($link_notes) ) 285 304 $link_notes = ''; 305 $link_notes = apply_filters('pre_link_notes', $link_notes); 306 307 if ( empty($link_description) ) 308 $link_description = ''; 309 $link_description = apply_filters('pre_link_description', $link_description); 310 311 if ( empty($link_rss) ) 312 $link_rss = ''; 313 $link_rss = apply_filters('pre_link_rss', $link_rss); 314 315 if ( empty($link_rel) ) 316 $link_rel = ''; 317 $link_rel = apply_filters('pre_link_rel', $link_rel); 318 319 // Make sure we set a valid category 320 if (0 == count($link_category) || !is_array($link_category)) { 321 $link_category = array(get_option('default_link_category')); 322 } 286 323 287 324 if ( $update ) { -
branches/2.0/wp-admin/admin-functions.php
r4051 r4229 266 266 $post->post_title = apply_filters('title_edit_pre', $post->post_title); 267 267 268 $post->post_password = format_to_edit($post->post_password); 269 268 270 if ($post->post_status == 'static') 269 271 $post->page_template = get_post_meta($id, '_wp_page_template', true); … … 332 334 333 335 return $category; 336 } 337 338 function get_user_to_edit($user_id) { 339 $user = new WP_User($user_id); 340 $user->user_login = wp_specialchars($user->user_login, 1); 341 $user->user_email = wp_specialchars($user->user_email, 1); 342 $user->user_url = wp_specialchars($user->user_url, 1); 343 $user->first_name = wp_specialchars($user->first_name, 1); 344 $user->last_name = wp_specialchars($user->last_name, 1); 345 $user->display_name = wp_specialchars($user->display_name, 1); 346 $user->nickname = wp_specialchars($user->nickname, 1); 347 $user->aim = wp_specialchars($user->aim, 1); 348 $user->yim = wp_specialchars($user->yim, 1); 349 $user->jabber = wp_specialchars($user->jabber, 1); 350 $user->description = wp_specialchars($user->description); 351 352 return $user; 334 353 } 335 354 … … 448 467 function get_link_to_edit($link_id) { 449 468 $link = get_link($link_id); 450 469 451 470 $link->link_url = wp_specialchars($link->link_url, 1); 452 471 $link->link_name = wp_specialchars($link->link_name, 1); 453 $link->link_description = wp_specialchars($link->link_description); 472 $link->link_image = wp_specialchars($link->link_image, 1); 473 $link->link_description = wp_specialchars($link->link_description, 1); 454 474 $link->link_notes = wp_specialchars($link->link_notes); 455 $link->link_rss = wp_specialchars($link->link_rss); 456 475 $link->link_rss = wp_specialchars($link->link_rss, 1); 476 $link->link_rel = wp_specialchars($link->link_rel, 1); 477 $link->post_category = $link->link_category; 478 457 479 return $link; 458 480 } … … 877 899 878 900 foreach ($keys as $key) { 901 $key = wp_specialchars($key, 1); 879 902 echo "\n\t<option value='$key'>$key</option>"; 880 903 } -
branches/2.0/wp-admin/edit-form-advanced.php
r4223 r4229 40 40 $already_pinged = explode("\n", trim($post->pinged)); 41 41 foreach ($already_pinged as $pinged_url) { 42 $pings .= "\n\t<li> $pinged_url</li>";42 $pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>"; 43 43 } 44 44 $pings .= '</ul>'; -
branches/2.0/wp-admin/options-misc.php
r3771 r4229 18 18 <tr valign="top"> 19 19 <th scope="row"><?php _e('Store uploads in this folder'); ?>:</th> 20 <td><input name="upload_path" type="text" id="upload_path" class="code" value="<?php echo str_replace(ABSPATH, '', get_settings('upload_path')); ?>" size="40" />20 <td><input name="upload_path" type="text" id="upload_path" class="code" value="<?php echo wp_specialchars(str_replace(ABSPATH, '', get_settings('upload_path')), 1); ?>" size="40" /> 21 21 <br /> 22 22 <?php _e('Default is <code>wp-content/uploads</code>'); ?> -
branches/2.0/wp-admin/options-permalink.php
r3771 r4229 149 149 <br /> 150 150 </p> 151 <p id="customstructure"><?php _e('Custom structure'); ?>: <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo $permalink_structure; ?>" size="50" /></p>151 <p id="customstructure"><?php _e('Custom structure'); ?>: <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo wp_specialchars($permalink_structure, 1); ?>" size="50" /></p> 152 152 153 153 <h3><?php _e('Optional'); ?></h3> … … 158 158 <?php endif; ?> 159 159 <p> 160 <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" />160 <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo wp_specialchars($category_base, 1); ?>" size="30" /> 161 161 </p> 162 162 <p class="submit"> -
branches/2.0/wp-admin/options.php
r3909 r4229 25 25 die ( __('Cheatin’ uh?') ); 26 26 27 function sanitize_option($option, $value) { 28 29 switch ($option) { 30 case 'admin_email': 31 $value = sanitize_email($value); 32 break; 33 34 case 'default_post_edit_rows': 35 case 'mailserver_port': 36 case 'comment_max_links': 37 $value = abs((int) $value); 38 break; 39 40 case 'posts_per_page': 41 case 'posts_per_rss': 42 $value = (int) $value; 43 if ( empty($value) ) $value = 1; 44 if ( $value < -1 ) $value = abs($value); 45 break; 46 47 case 'default_ping_status': 48 case 'default_comment_status': 49 // Options that if not there have 0 value but need to be something like "closed" 50 if ( $value == '0' || $value == '') 51 $value = 'closed'; 52 break; 53 54 case 'blogdescription': 55 case 'blogname': 56 if (current_user_can('unfiltered_html') == false) 57 $value = wp_filter_post_kses( $value ); 58 break; 59 60 case 'blog_charset': 61 $value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); 62 break; 63 64 case 'date_format': 65 case 'time_format': 66 case 'mailserver_url': 67 case 'mailserver_login': 68 case 'mailserver_pass': 69 case 'ping_sites': 70 case 'upload_path': 71 $value = strip_tags($value); 72 $value = wp_filter_kses($value); 73 break; 74 75 case 'gmt_offset': 76 $value = preg_replace('/[^0-9:.-]/', '', $value); 77 break; 78 79 case 'siteurl': 80 case 'home': 81 $value = clean_url($value); 82 break; 83 } 84 85 return $value; 86 } 87 27 88 switch($action) { 28 89 … … 44 105 $old_home = get_settings('home'); 45 106 46 // HACK47 // Options that if not there have 0 value but need to be something like "closed"48 $nonbools = array('default_ping_status', 'default_comment_status');49 107 if ($options) { 50 108 foreach ($options as $option) { 51 109 $option = trim($option); 52 110 $value = trim(stripslashes($_POST[$option])); 53 if( in_array($option, $nonbools) && ( $value == '0' || $value == '') ) 54 $value = 'closed'; 55 56 if( $option == 'blogdescription' || $option == 'blogname' ) 57 if (current_user_can('unfiltered_html') == false) 58 $value = wp_filter_post_kses( $value ); 111 $value = sanitize_option($option, $value); 59 112 60 113 if (update_option($option, $value) ) { -
branches/2.0/wp-admin/profile.php
r3805 r4229 6 6 $parent_file = 'profile.php'; 7 7 include_once('admin-header.php'); 8 $profileuser = new WP_User($user_ID);8 $profileuser = get_user_to_edit($user_ID); 9 9 10 10 $bookmarklet_height= 440; -
branches/2.0/wp-admin/user-edit.php
r3937 r4229 50 50 include ('admin-header.php'); 51 51 52 $profileuser = new WP_User($user_id);52 $profileuser = get_user_to_edit($user_id); 53 53 54 54 if (!current_user_can('edit_users')) $errors['head'] = __('You do not have permission to edit this user.'); -
branches/2.0/wp-includes/default-filters.php
r4044 r4229 58 58 add_filter('pre_category_description', 'wp_filter_kses'); 59 59 60 //Links 61 add_filter('pre_link_name', 'strip_tags'); 62 add_filter('pre_link_name', 'trim'); 63 add_filter('pre_link_name', 'wp_filter_kses'); 64 add_filter('pre_link_name', 'wp_specialchars', 30); 65 add_filter('pre_link_description', 'wp_filter_kses'); 66 add_filter('pre_link_notes', 'wp_filter_kses'); 67 add_filter('pre_link_url', 'strip_tags'); 68 add_filter('pre_link_url', 'trim'); 69 add_filter('pre_link_url', 'clean_url'); 70 add_filter('pre_link_image', 'strip_tags'); 71 add_filter('pre_link_image', 'trim'); 72 add_filter('pre_link_image', 'clean_url'); 73 add_filter('pre_link_rss', 'strip_tags'); 74 add_filter('pre_link_rss', 'trim'); 75 add_filter('pre_link_rss', 'clean_url'); 76 add_filter('pre_link_target', 'strip_tags'); 77 add_filter('pre_link_target', 'trim'); 78 add_filter('pre_link_target', 'wp_filter_kses'); 79 add_filter('pre_link_target', 'wp_specialchars', 30); 80 add_filter('pre_link_rel', 'strip_tags'); 81 add_filter('pre_link_rel', 'trim'); 82 add_filter('pre_link_rel', 'wp_filter_kses'); 83 add_filter('pre_link_rel', 'wp_specialchars', 30); 84 60 85 // Users 61 86 add_filter('pre_user_display_name', 'strip_tags'); … … 116 141 add_filter('the_author', 'ent2ncr', 8); 117 142 143 <<<<<<< .working 144 ======= 145 // Misc filters 146 add_filter('option_ping_sites', 'privacy_ping_filter'); 147 add_filter('option_blog_charset', 'wp_specialchars'); 148 149 >>>>>>> .merge-right.r4112 118 150 // Actions 119 151 add_action('publish_post', 'generic_ping'); -
branches/2.0/wp-includes/functions.php
r4048 r4229 322 322 323 323 function form_option($option) { 324 echo htmlspecialchars( get_option($option), ENT_QUOTES);324 echo wp_specialchars( get_option($option), 1 ); 325 325 } 326 326
Note: See TracChangeset
for help on using the changeset viewer.