Permalink
Browse files

More clean_url and int casts for 2.1.

git-svn-id: http://svn.automattic.com/wordpress/branches/2.1@5120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent b1deb1d commit 09a10da767777c997fe3c983e8dc790058eb07f9 ryan committed Mar 27, 2007
Showing with 4 additions and 1 deletion.
  1. +1 −1 wp-admin/admin-functions.php
  2. +1 −0 wp-includes/bookmark.php
  3. +1 −0 wp-includes/category.php
  4. +1 −0 wp-includes/comment.php
@@ -478,7 +478,7 @@ function edit_user( $user_id = 0 ) {
if ( isset( $_POST['email'] ))
$user->user_email = wp_specialchars( trim( $_POST['email'] ));
if ( isset( $_POST['url'] ) ) {
- $user->user_url = wp_specialchars( trim( $_POST['url'] ));
+ $user->user_url = clean_url( trim( $_POST['url'] ));
$user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
}
if ( isset( $_POST['first_name'] ))
@@ -3,6 +3,7 @@
function get_bookmark($bookmark_id, $output = OBJECT) {
global $wpdb;
+ $bookmark_id = (int) $bookmark_id;
$link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$bookmark_id'");
$link->link_category = wp_get_link_cats($bookmark_id);
@@ -146,6 +146,7 @@ function &get_category(&$category, $output = OBJECT) {
wp_cache_add($category->cat_ID, $category, 'category');
$_category = $category;
} else {
+ $category = (int) $category;
if ( ! $_category = wp_cache_get($category, 'category') ) {
$_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1");
wp_cache_set($category, $_category, 'category');
@@ -81,6 +81,7 @@ function &get_comment(&$comment, $output = OBJECT) {
$comment_cache[$comment->comment_ID] = &$comment;
$_comment = & $comment_cache[$comment->comment_ID];
} else {
+ $comment = (int) $comment;
if ( !isset($comment_cache[$comment]) ) {
$_comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment' LIMIT 1");
$comment_cache[$comment->comment_ID] = & $_comment;

0 comments on commit 09a10da

Please sign in to comment.