Last modified: 2013-04-04 01:59:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T22008, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20008 - Glossary: Escaping forward slashes for PCRE functions
Glossary: Escaping forward slashes for PCRE functions
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Glossary (Other open bugs)
unspecified
All All
: Low critical (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-30 12:17 UTC by David Hicks
Modified: 2013-04-04 01:59 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description David Hicks 2009-07-30 12:17:20 UTC
From http://www.mediawiki.org/wiki/Extension:Glossary#Escaping_forward_slashes_for_PCRE_functions

On line 82 within the glossaryParseThisNode function, the following code exists:

    $texts = preg_split('/\b(' . preg_quote($term) . 's?)\b/iu', $node->textContent, -1, PREG_SPLIT_DELIM_CAPTURE);

preg_quote() is meant to escape special regular expression characters from glossary terms. However by default it will not escape the forward slash character that has special meaning in PCRE regular expression functions. You will therefore need to change line 82 to:

    $texts = preg_split('/\b(' . preg_quote($term, '/') . 's?)\b/iu', $node->textContent, -1, PREG_SPLIT_DELIM_CAPTURE);

Without this fix, glossary terms containing a forward slash may cause a lot of rendering errors that make your MediaWiki installation unusable.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links