Changeset 7348 for trunk/wp-admin/includes/media.php
- Timestamp:
- 03/17/2008 08:08:43 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/media.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r7304 r7348 269 269 if ( !empty($_POST['insertonlybutton']) ) { 270 270 $src = $_POST['insertonly']['src']; 271 if ( ! strpos($src, '://') )271 if ( !empty($src) && !strpos($src, '://') ) 272 272 $src = "http://$src"; 273 273 $alt = attribute_escape($_POST['insertonly']['alt']); … … 276 276 $class = " class='align$align'"; 277 277 } 278 $html = "<img src='$src' alt='$alt'$class />"; 278 if ( !empty($src) ) 279 $html = "<img src='$src' alt='$alt'$class />"; 279 280 return media_send_to_editor($html); 280 281 } … … 305 306 if ( !empty($_POST['insertonlybutton']) ) { 306 307 $href = $_POST['insertonly']['href']; 307 if ( ! strpos($href, '://') )308 if ( !empty($href) && !strpos($href, '://') ) 308 309 $href = "http://$href"; 309 310 $title = attribute_escape($_POST['insertonly']['title']); 310 $html = "<a href='$href' >$title</a>"; 311 if ( empty($title) ) 312 $title = basename($href); 313 if ( !empty($title) && !empty($href) ) 314 $html = "<a href='$href' >$title</a>"; 311 315 return media_send_to_editor($html); 312 316 } … … 337 341 if ( !empty($_POST['insertonlybutton']) ) { 338 342 $href = $_POST['insertonly']['href']; 339 if ( ! strpos($href, '://') )343 if ( !empty($href) && !strpos($href, '://') ) 340 344 $href = "http://$href"; 341 345 $title = attribute_escape($_POST['insertonly']['title']); 342 $html = "<a href='$href' >$title</a>"; 346 if ( empty($title) ) 347 $title = basename($href); 348 if ( !empty($title) && !empty($href) ) 349 $html = "<a href='$href' >$title</a>"; 343 350 return media_send_to_editor($html); 344 351 } … … 369 376 if ( !empty($_POST['insertonlybutton']) ) { 370 377 $href = $_POST['insertonly']['href']; 371 if ( ! strpos($href, '://') )378 if ( !empty($href) && !strpos($href, '://') ) 372 379 $href = "http://$href"; 373 380 $title = attribute_escape($_POST['insertonly']['title']); 374 $html = "<a href='$href' >$title</a>"; 381 if ( empty($title) ) 382 $title = basename($href); 383 if ( !empty($title) && !empty($href) ) 384 $html = "<a href='$href' >$title</a>"; 375 385 return media_send_to_editor($html); 376 386 } … … 1068 1078 <th valign="top" scope="row" class="label"> 1069 1079 <span class="alignleft"><label for="insertonly[alt]">' . __('Description') . '</label></span> 1070 <span class="alignright"><abbr title="required" >*</abbr></span>1080 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 1071 1081 </th> 1072 1082 <td class="field"><input id="insertonly[alt]" name="insertonly[alt]" value="" type="text"></td>
Note: See TracChangeset
for help on using the changeset viewer.