Changeset 24554 for trunk/wp-includes/post-formats.php
- Timestamp:
- 07/03/2013 10:36:13 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post-formats.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.