Changeset 28475 for trunk/src/wp-admin/includes/bookmark.php
- Timestamp:
- 05/18/2014 09:55:16 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/bookmark.php
r28408 r28475 148 148 149 149 $args = wp_parse_args( $linkdata, $defaults ); 150 $r = sanitize_bookmark( $args, 'db' ); 150 $r = wp_unslash( sanitize_bookmark( $args, 'db' ) ); 151 152 $link_id = $r['link_id']; 153 $link_name = $r['link_name']; 154 $link_url = $r['link_url']; 151 155 152 156 $update = false; 153 if ( ! empty( $ r['link_id']) ) {157 if ( ! empty( $link_id ) ) { 154 158 $update = true; 155 159 } 156 160 157 if ( trim( $ r['link_name']) == '' ) {158 if ( trim( $ r['link_url']) != '' ) {159 $ r['link_name'] = $r['link_url'];161 if ( trim( $link_name ) == '' ) { 162 if ( trim( $link_url ) != '' ) { 163 $link_name = $link_url; 160 164 } else { 161 165 return 0; … … 163 167 } 164 168 165 if ( trim( $ r['link_url']) == '' ) {169 if ( trim( $link_url ) == '' ) { 166 170 return 0; 167 171 } 168 if ( empty( $r['link_rating'] ) ) { 169 $r['link_rating'] = 0; 170 } 171 if ( empty( $r['link_image'] ) ) { 172 $r['link_image'] = ''; 173 } 174 if ( empty( $r['link_target'] ) ) { 175 $r['link_target'] = ''; 176 } 177 if ( empty( $r['link_visible'] ) ) { 178 $r['link_visible'] = 'Y'; 179 } 180 if ( empty( $r['link_owner'] ) ) { 181 $r['link_owner'] = get_current_user_id(); 182 } 183 if ( empty( $r['link_notes'] ) ) { 184 $r['link_notes'] = ''; 185 } 186 if ( empty( $r['link_description'] ) ) { 187 $r['link_description'] = ''; 188 } 189 if ( empty( $r['link_rss'] ) ) { 190 $r['link_rss'] = ''; 191 } 192 if ( empty( $r['link_rel'] ) ) { 193 $r['link_rel'] = ''; 194 } 172 173 $link_rating = ( ! empty( $r['link_rating'] ) ) ? $r['link_rating'] : 0; 174 $link_image = ( ! empty( $r['link_image'] ) ) ? $r['link_image'] : ''; 175 $link_target = ( ! empty( $r['link_target'] ) ) ? $r['link_target'] : ''; 176 $link_visible = ( ! empty( $r['link_visible'] ) ) ? $r['link_visible'] : 'Y'; 177 $link_owner = ( ! empty( $r['link_owner'] ) ) ? $r['link_owner'] : get_current_user_id(); 178 $link_notes = ( ! empty( $r['link_notes'] ) ) ? $r['link_notes'] : ''; 179 $link_description = ( ! empty( $r['link_description'] ) ) ? $r['link_description'] : ''; 180 $link_rss = ( ! empty( $r['link_rss'] ) ) ? $r['link_rss'] : ''; 181 $link_rel = ( ! empty( $r['link_rel'] ) ) ? $r['link_rel'] : ''; 182 $link_category = ( ! empty( $r['link_category'] ) ) ? $r['link_category'] : array(); 195 183 196 184 // Make sure we set a valid category 197 if ( ! is set( $r['link_category'] ) || ! is_array( $r['link_category'] ) || 0 == count( $r['link_category']) ) {185 if ( ! is_array( $link_category ) || 0 == count( $link_category ) ) { 198 186 $link_category = array( get_option( 'default_link_category' ) ); 199 187 }
Note: See TracChangeset
for help on using the changeset viewer.