Changeset 1940 for trunk/wp-admin/link-manager.php
- Timestamp:
- 12/12/2004 08:41:19 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/link-manager.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/link-manager.php
r1856 r1940 33 33 if ($row->cat_id == $selected) 34 34 echo " selected='selected'"; 35 echo ">$row->cat_id: ". htmlspecialchars($row->cat_name);35 echo ">$row->cat_id: ".wp_specialchars($row->cat_name); 36 36 if ('Y' == $row->auto_toggle) 37 37 echo ' (auto toggle)'; … … 161 161 check_admin_referer(); 162 162 163 $link_url = $_POST['linkurl'];163 $link_url = wp_specialchars($_POST['linkurl']); 164 164 $link_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $link_url) ? $link_url : 'http://' . $link_url; 165 $link_name = $_POST['name'];166 $link_image = $_POST['image'];165 $link_name = wp_specialchars($_POST['name']); 166 $link_image = wp_specialchars($_POST['image']); 167 167 $link_target = $_POST['target']; 168 168 $link_category = $_POST['category']; … … 172 172 $link_rel = $_POST['rel']; 173 173 $link_notes = $_POST['notes']; 174 $link_rss_uri = $_POST['rss_uri'];174 $link_rss_uri = wp_specialchars($_POST['rss_uri']); 175 175 $auto_toggle = get_autotoggle($link_category); 176 176 … … 208 208 check_admin_referer(); 209 209 210 $link_id = $_POST['link_id'];211 $link_url = $_POST['linkurl'];210 $link_id = (int) $_POST['link_id']; 211 $link_url = wp_specialchars($_POST['linkurl']); 212 212 $link_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $link_url) ? $link_url : 'http://' . $link_url; 213 $link_name = $_POST['name'];214 $link_image = $_POST['image'];215 $link_target = $_POST['target'];213 $link_name = wp_specialchars($_POST['name']); 214 $link_image = wp_specialchars($_POST['image']); 215 $link_target = wp_specialchars($_POST['target']); 216 216 $link_category = $_POST['category']; 217 217 $link_description = $_POST['description']; … … 271 271 } // end Delete 272 272 273 case 'linkedit': 274 { 273 case 'linkedit': { 275 274 $xfn = true; 276 275 include_once ('admin-header.php'); 277 if ($user_level < 5) {276 if ($user_level < 5) 278 277 die(__('You do not have sufficient permissions to edit the links for this blog.')); 279 } 278 280 279 $link_id = (int) $_GET['link_id']; 281 $row = $wpdb->get_row("SELECT * 282 FROM $wpdb->links 283 WHERE link_id = $link_id"); 280 $row = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = $link_id"); 284 281 285 282 if ($row) { 286 $link_url = htmlspecialchars($row->link_url);287 $link_name = htmlspecialchars($row->link_name);283 $link_url = wp_specialchars($row->link_url, 1); 284 $link_name = wp_specialchars($row->link_name, 1); 288 285 $link_image = $row->link_image; 289 286 $link_target = $row->link_target; 290 287 $link_category = $row->link_category; 291 $link_description = htmlspecialchars($row->link_description);288 $link_description = wp_specialchars($row->link_description); 292 289 $link_visible = $row->link_visible; 293 290 $link_rating = $row->link_rating; 294 291 $link_rel = $row->link_rel; 295 $link_notes = htmlspecialchars($row->link_notes); 296 $link_rss_uri = htmlspecialchars($row->link_rss); 297 } 292 $link_notes = wp_specialchars($row->link_notes); 293 $link_rss_uri = wp_specialchars($row->link_rss); 294 } else { 295 die( __('Link not found.') ); 296 } 298 297 299 298 ?> … … 493 492 <p class="submit"><input type="submit" name="submit" value="<?php _e('Save Changes »') ?>" /> 494 493 <input type="hidden" name="action" value="editlink" /> 495 <input type="hidden" name="link_id" value="<?php echo $link_id; ?>" />496 <input type="hidden" name="order_by" value="<?php echo $order_by?>" />497 <input type="hidden" name="cat_id" value="<?php echo $cat_id ?>" /></p>494 <input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" /> 495 <input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" /> 496 <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" /></p> 498 497 </form> 499 498 </div> … … 599 598 if ($row->cat_id == $cat_id) 600 599 echo " selected='selected'"; 601 echo ">".$row->cat_id.": ". htmlspecialchars($row->cat_name);600 echo ">".$row->cat_id.": ".wp_specialchars($row->cat_name); 602 601 if ($row->auto_toggle == 'Y') 603 602 echo ' (auto toggle)'; … … 631 630 <input type="hidden" name="link_id" value="" /> 632 631 <input type="hidden" name="action" value="" /> 633 <input type="hidden" name="order_by" value="<?php echo $order_by?>" />634 <input type="hidden" name="cat_id" value="<?php echo $cat_id ?>" />632 <input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" /> 633 <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" /> 635 634 <table width="100%" cellpadding="3" cellspacing="3"> 636 635 <tr> … … 661 660 if ($links) { 662 661 foreach ($links as $link) { 663 $link->link_name = htmlspecialchars($link->link_name);664 $link->link_category = htmlspecialchars($link->link_category);665 $link->link_description = htmlspecialchars($link->link_description);666 $link->link_url = htmlspecialchars($link->link_url);662 $link->link_name = wp_specialchars($link->link_name); 663 $link->link_category = wp_specialchars($link->link_category); 664 $link->link_description = wp_specialchars($link->link_description); 665 $link->link_url = wp_specialchars($link->link_url); 667 666 $short_url = str_replace('http://', '', $link->link_url); 668 667 $short_url = str_replace('www.', '', $short_url); … … 754 753 ?> 755 754 756 757 758 755 <?php include('admin-footer.php'); ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)