Make WordPress Core

Ticket #26171: 26171.diff

File 26171.diff, 635 bytes (added by mdbitz, 11 years ago)

modification to return false in all cases where no links exist, compliant with coding standards

  • src/wp-includes/formatting.php

     
    34543454 * @return string The found URL.
    34553455 */
    34563456function get_url_in_content( $content ) {
    3457         if ( empty( $content ) )
    3458                 return '';
     3457        if ( empty( $content ) ) {
     3458                return false;
     3459        }
    34593460
    3460         if ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) )
     3461        if ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) {
    34613462                return esc_url_raw( $matches[2] );
     3463        }
    34623464
    34633465        return false;
    34643466}