Ticket #17267: 17267.diff
| File 17267.diff, 951 bytes (added by , 15 years ago) |
|---|
-
wp-content/themes/twentyeleven/functions.php
433 433 * Grab the first URL from a Link post 434 434 */ 435 435 function twentyeleven_url_grabber() { 436 global $post, $posts; 437 438 $first_url = ''; 439 440 ob_start(); 441 ob_end_clean(); 442 443 $output = preg_match_all('/<a.+href=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); 444 445 $first_url = $matches [1] [0]; 446 447 if ( empty( $first_url ) ) 436 if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) 448 437 return false; 449 438 450 return $first_url;439 return esc_url_raw( $matches[1] ); 451 440 } 452 441 453 442 /** … … 547 536 break; 548 537 endswitch; 549 538 } 550 endif; // ends check for twentyeleven_comment() 551 No newline at end of file 539 endif; // ends check for twentyeleven_comment()