Changeset 44833 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 03/12/2019 10:14:14 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r44731 r44833 3005 3005 $rel = 'nofollow'; 3006 3006 3007 if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) || 3008 preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text ) ) { 3009 3010 return "<a $text>"; 3007 if ( ! empty( $atts['href'] ) ) { 3008 if ( in_array( strtolower( wp_parse_url( $atts['href'], PHP_URL_SCHEME ) ), array( 'http', 'https' ), true ) ) { 3009 if ( strtolower( wp_parse_url( $atts['href'], PHP_URL_HOST ) ) === strtolower( wp_parse_url( home_url(), PHP_URL_HOST ) ) ) { 3010 return "<a $text>"; 3011 } 3012 } 3011 3013 } 3012 3014 … … 3021 3023 $html = ''; 3022 3024 foreach ( $atts as $name => $value ) { 3023 $html .= "{$name}=\" $value\" ";3025 $html .= "{$name}=\"" . esc_attr( $value ) . "\" "; 3024 3026 } 3025 3027 $text = trim( $html ); 3026 3028 } 3027 return "<a $text rel=\" $rel\">";3029 return "<a $text rel=\"" . esc_attr( $rel ) . "\">"; 3028 3030 } 3029 3031
Note: See TracChangeset
for help on using the changeset viewer.