WordPress.org

Make WordPress Core

Ticket #45352: 45352.diff

File 45352.diff, 829 bytes (added by mcmwebsol, 2 years ago)

patch for 45352

  • wp-includes/formatting.php

     
    27802780 * @return string Converted content.
    27812781 */
    27822782function wp_targeted_link_rel( $text ) {
     2783 
     2784  $original_text = $text;
     2785 
    27832786        // Don't run (more expensive) regex if no links with targets.
    27842787        if ( stripos( $text, 'target' ) !== false && stripos( $text, '<a ' ) !== false ) {
    27852788                $text = preg_replace_callback( '|<a\s([^>]*target\s*=[^>]*)>|i', 'wp_targeted_link_rel_callback', $text );
    27862789        }
     2790 
     2791  // Return original link from wp_targeted_link_rel_callback after applying wp_targeted_link_rel if rel is empty.
     2792  if ( strpos( $text, 'rel=""' ) !== false ) {
     2793    return $original_text;
     2794  }
    27872795
    27882796        return $text;
    27892797}