Changeset 5121

Show
Ignore:
Timestamp:
03/27/07 23:47:02 (1 year ago)
Author:
ryan
Message:

More clean_url and int casts for 2.0.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.0/wp-admin/admin-functions.php

    r5070 r5121  
    290290        $text       = wp_specialchars(stripslashes(urldecode($_REQUEST['text']))); 
    291291        $text       = funky_javascript_fix($text); 
    292         $popupurl   = attribute_escape(stripslashes($_REQUEST['popupurl'])); 
     292        $popupurl   = clean_url(stripslashes($_REQUEST['popupurl'])); 
    293293        $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 
    294294    } 
     
    340340    $user->user_login   = attribute_escape($user->user_login); 
    341341    $user->user_email   = attribute_escape($user->user_email); 
    342     $user->user_url     = attribute_escape($user->user_url); 
     342    $user->user_url     = clean_url($user->user_url); 
    343343    $user->first_name   = attribute_escape($user->first_name); 
    344344    $user->last_name    = attribute_escape($user->last_name); 
     
    364364    if ($user_id != 0) { 
    365365        $update = true; 
    366         $user->ID = $user_id; 
     366        $user->ID = (int) $user_id; 
    367367        $userdata = get_userdata($user_id); 
    368368        $user->user_login = $wpdb->escape($userdata->user_login); 
     
    389389        $user->user_email = wp_specialchars(trim($_POST['email'])); 
    390390    if (isset ($_POST['url'])) { 
    391         $user->user_url = wp_specialchars(trim($_POST['url'])); 
     391        $user->user_url = clean_url(trim($_POST['url'])); 
    392392        $user->user_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url; 
    393393    } 
     
    867867                <td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td> 
    868868                <td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td> 
    869                 <td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='".__('Update')."' /><br /> 
    870                 <input name='deletemeta[{$entry['meta_id']}]' type='submit' class='deletemeta' tabindex='6' value='".__('Delete')."' /></td> 
     869                <td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='".attribute_escape(__('Update'))."' /><br /> 
     870                <input name='deletemeta[{$entry['meta_id']}]' type='submit' class='deletemeta' tabindex='6' value='".attribute_escape(__('Delete'))."' /></td> 
    871871            </tr> 
    872872        "; 
     
    932932function add_meta($post_ID) { 
    933933    global $wpdb; 
     934    $post_ID = (int) $post_ID; 
    934935 
    935936    $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect']))); 
     
    958959function delete_meta($mid) { 
    959960    global $wpdb; 
     961    $mid = (int) $mid; 
    960962 
    961963    $result = $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 
  • branches/2.0/wp-includes/functions.php

    r5100 r5121  
    771771        $_category = $category; 
    772772    } else { 
     773        $category = (int) $category; 
    773774        if ( ! $_category = wp_cache_get($category, 'category') ) { 
    774775            $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1"); 
     
    808809        $_comment = & $comment_cache[$comment->comment_ID]; 
    809810    } else { 
     811        $comment = (int) $comment; 
    810812        if ( !isset($comment_cache[$comment]) ) { 
    811813            $_comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment' LIMIT 1");