Make WordPress Core


Ignore:
Timestamp:
05/10/2013 10:54:33 PM (12 years ago)
Author:
markjaquith
Message:

Improve regular expressions by using a backreference to match right quote of quote pair when matching attributes.

props kovshenin. see #24225.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r24229 r24241  
    32073207    global $_links_add_target;
    32083208    $tag = $m[1];
    3209     $link = preg_replace('|(target=[\'"](.*?)[\'"])|i', '', $m[2]);
     3209    $link = preg_replace('|(target=([\'"])(.*?)\2)|i', '', $m[2]);
    32103210    return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">';
    32113211}
Note: See TracChangeset for help on using the changeset viewer.