Make WordPress Core


Ignore:
Timestamp:
09/25/2006 02:09:08 AM (20 years ago)
Author:
ryan
Message:

Make those chars feel special.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-admin/admin-db.php

    r4032 r4229  
    267267
    268268        $update = false;
     269
    269270        if ( !empty($link_id) )
    270271                $update = true;
    271272
     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
    272281        if ( empty($link_rating) )
    273282                $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);
    274289
    275290        if ( empty($link_target) )
    276291                $link_target = '';     
     292        $link_target = apply_filters('pre_link_target', $link_target);
    277293
    278294        if ( empty($link_visible) )
    279295                $link_visible = 'Y';
    280                
     296        $link_visibile = preg_replace('/[^YNyn]/', '', $link_visible);
     297
    281298        if ( empty($link_owner) )
    282299                $link_owner = $current_user->id;
     300        else
     301                $link_owner = (int) $link_owner;
    283302
    284303        if ( empty($link_notes) )
    285304                $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        }
    286323
    287324        if ( $update ) {
Note: See TracChangeset for help on using the changeset viewer.