Opened 3 years ago

Closed 3 years ago

Last modified 3 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@…> 3 years ago.

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by theYT <dev@…>

comment:1 Changed 3 years ago by rjollos

  • Owner changed from trapanator to rjollos
  • Status changed from new to accepted

comment:2 Changed 3 years ago by jun66j5

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 3 years ago by rjollos

  • Resolution set to fixed
  • Status changed from accepted to closed

In 13928:

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

Patch by Jun Omae.

comment:4 Changed 3 years ago by rjollos

  • Owner changed from rjollos to jomae

Add Comment

Modify Ticket

as closed The owner will remain jomae.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.