Changeset 44838 for branches/4.7/src/wp-includes/formatting.php
- Timestamp:
- 03/12/2019 10:21:44 PM (6 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/src/wp-includes/formatting.php
r40091 r44838 2734 2734 $rel = 'nofollow'; 2735 2735 2736 if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) || 2737 preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text ) 2738 ) { 2739 return "<a $text>"; 2736 if ( ! empty( $atts['href'] ) ) { 2737 if ( in_array( strtolower( wp_parse_url( $atts['href'], PHP_URL_SCHEME ) ), array( 'http', 'https' ), true ) ) { 2738 if ( strtolower( wp_parse_url( $atts['href'], PHP_URL_HOST ) ) === strtolower( wp_parse_url( home_url(), PHP_URL_HOST ) ) ) { 2739 return "<a $text>"; 2740 } 2741 } 2740 2742 } 2741 2743 … … 2750 2752 $html = ''; 2751 2753 foreach ( $atts as $name => $value ) { 2752 $html .= "{$name}=\" $value\" ";2754 $html .= "{$name}=\"" . esc_attr( $value ) . "\" "; 2753 2755 } 2754 2756 $text = trim( $html ); 2755 2757 } 2756 return "<a $text rel=\" $rel\">";2758 return "<a $text rel=\"" . esc_attr( $rel ) . "\">"; 2757 2759 } 2758 2760
Note: See TracChangeset
for help on using the changeset viewer.