Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#11707 closed defect (fixed)

Backlinks for Unicode page name

Reported by: theYT <dev@…> Owned by: jomae
Priority: normal Component: BackLinksMacro
Severity: normal Keywords: unicode regex regexp
Cc: Trac Release: 1.0


Pages with unicode (non-ASCII) name are not matched (filtered out) when testing with regex.

Patch file attached. (test with r13390)

Attachments (1) (515 bytes) - added by theYT <dev@…> 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by theYT <dev@…>

Attachment: added

comment:1 Changed 6 years ago by Ryan J Ollos

Owner: changed from Trap to Ryan J Ollos
Status: newaccepted

comment:2 Changed 6 years ago by Jun Omae

It seems backlinks_page should be escaped in regular expression, e.g. Languages/C++.

  • backlinks/

    8181        WHERE w1.version = w2.version AND = AND
    8282        (w1.text %s)""" %, ('%' + db.like_escape(backlinks_page) + '%',))
     84    pattern = re.compile(r'\b%s\b' % re.escape(backlinks_page), re.UNICODE)
    8485    backlinked_pages = []
    8586    for page, text in cursor:
    8687        if page != backlinks_page and page != caller_page and \
    87  '\b%s\b' % backlinks_page, text):
    8889            backlinked_pages.append(page)
    9091    return backlinked_pages

comment:3 Changed 6 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 13928:

7.0dev: Match pages with unicode characters in page name. Fixes #11707.

Patch by Jun Omae.

comment:4 Changed 6 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to jomae

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain jomae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.