Changeset 44836 for branches/4.9
- Timestamp:
- 03/12/2019 10:18:57 PM (6 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-includes/formatting.php
r43444 r44836 2751 2751 $rel = 'nofollow'; 2752 2752 2753 if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) || 2754 preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text ) 2755 ) { 2756 return "<a $text>"; 2753 if ( ! empty( $atts['href'] ) ) { 2754 if ( in_array( strtolower( wp_parse_url( $atts['href'], PHP_URL_SCHEME ) ), array( 'http', 'https' ), true ) ) { 2755 if ( strtolower( wp_parse_url( $atts['href'], PHP_URL_HOST ) ) === strtolower( wp_parse_url( home_url(), PHP_URL_HOST ) ) ) { 2756 return "<a $text>"; 2757 } 2758 } 2757 2759 } 2758 2760 … … 2767 2769 $html = ''; 2768 2770 foreach ( $atts as $name => $value ) { 2769 $html .= "{$name}=\" $value\" ";2771 $html .= "{$name}=\"" . esc_attr( $value ) . "\" "; 2770 2772 } 2771 2773 $text = trim( $html ); 2772 2774 } 2773 return "<a $text rel=\" $rel\">";2775 return "<a $text rel=\"" . esc_attr( $rel ) . "\">"; 2774 2776 } 2775 2777
Note: See TracChangeset
for help on using the changeset viewer.