Ticket #2729: regex_escape_dash.diff

File regex_escape_dash.diff, 529 bytes (added by markjaquith, 6 years ago)

patch to fix the regex

  • wp-includes/functions-formatting.php

     
    278278 
    279279        // If strict, reduce to ASCII for max portability. 
    280280        if ( $strict ) 
    281                 $username = preg_replace('|[^a-z0-9 _.-@]|i', '', $username); 
     281                $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); 
    282282 
    283283        return apply_filters('sanitize_user', $username, $raw_username, $strict); 
    284284}