Changeset 24554
- Timestamp:
- 07/03/2013 10:36:13 PM (11 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r24550 r24554 2425 2425 if ( ! $matched ) 2426 2426 $matched = do_shortcode_tag( $shortcode ); 2427 // $content = str_replace( $shortcode[0], '', $content, $count );2428 2427 } 2429 2428 } … … 2439 2438 if ( ! $matched ) 2440 2439 $matched = $match[0]; 2441 // $content = str_replace( $match[0], '', $content, $count );2442 2440 } 2443 2441 } … … 2506 2504 return $attachment_id; 2507 2505 2508 $classes = $matches[2]; 2509 if ( ! empty( $classes ) && false !== strpos( $classes, 'wp-image-' ) ) 2510 if ( preg_match( '#wp-image-([0-9]+)#i', $classes, $matches ) ) 2506 $classes = $matches[2]; 2507 if ( ! empty( $classes ) && false !== strpos( $classes, 'wp-image-' ) ) 2508 if ( preg_match( '#wp-image-([0-9]+)#i', $classes, $matches ) ) 2511 2509 $attachment_id = absint( $matches[1] ); 2512 2510 -
trunk/wp-includes/post-formats.php
r24399 r24554 241 241 * @since 3.6.0 242 242 * 243 * @param string $content A string which might contain a URL, passed by reference. 244 * @param boolean $remove Whether to remove the found URL from the passed content. 243 * @param string $content A string which might contain a URL. 245 244 * @return string The found URL. 246 245 */ 247 function get_content_url( &$content, $remove = false) {246 function get_content_url( $content ) { 248 247 if ( empty( $content ) ) 249 248 return ''; … … 252 251 $trimmed = trim( $content ); 253 252 if ( 0 === stripos( $trimmed, 'http' ) && ! preg_match( '#\s#', $trimmed ) ) { 254 if ( $remove )255 $content = '';256 257 253 return $trimmed; 254 258 255 // the content is HTML so we grab the first href 259 256 } elseif ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) { … … 265 262 266 263 // the content is a URL followed by content 267 if ( 0 === stripos( $line, 'http' ) ) { 268 if ( $remove ) 269 $content = trim( join( "\n", $lines ) ); 270 264 if ( 0 === stripos( $line, 'http' ) ) 271 265 return esc_url_raw( $line ); 272 }273 266 274 267 return '';
Note: See TracChangeset
for help on using the changeset viewer.