Making WordPress.org

Changeset 3736


Ignore:
Timestamp:
07/29/2016 01:18:06 AM (8 years ago)
Author:
nacin
Message:

Trac: Catch exception that appears to be caused by anonymous users. fixes #1759.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/trac.wordpress.org/templates/site-ticket.html

    r3147 r3736  
    3434  import re
    3535  def wporg_sanitize_user_nicename(str):
    36     str = str.lower()
    37     str = re.sub(r'[^%a-z0-9\x80-\xff _-]', '', str)
    38     str = str.strip()
    39     str = re.sub(r'\s+', '-', str)
    40     str = re.sub(r'-+', '-', str)
    41     str = re.sub(r'_+', '_', str)
     36    try:
     37      str = str.lower()
     38      str = re.sub(r'[^%a-z0-9\x80-\xff _-]', '', str)
     39      str = str.strip()
     40      str = re.sub(r'\s+', '-', str)
     41      str = re.sub(r'-+', '-', str)
     42      str = re.sub(r'_+', '_', str)
     43    except AttributeError:
     44      pass
    4245    return str;
    4346?>
Note: See TracChangeset for help on using the changeset viewer.