Last modified: 2014-05-14 18:56:38 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 T67278, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65278 - RFC/PMID/ISBN regexes need \b restrictions before and after
RFC/PMID/ISBN regexes need \b restrictions before and after
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.24rc
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-14 00:37 UTC by C. Scott Ananian
Modified: 2014-05-14 18:56 UTC (History)
0 users

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


Attachments

Description C. Scott Ananian 2014-05-14 00:37:51 UTC
The PHP parser currently recognizes RFC/PMID/ISBN links even if they are buried in unrelated text, for example:

fooRFC 1234bar

We should add \b restrictions to the regexp to ensure that magic links stand apart from other text.

See also bug 28950, which asks for the whitespace restrictions in magic links to be loosened somewhat.
Comment 1 Andre Klapper 2014-05-14 13:05:43 UTC
Source code file name (and path) welcome in case a contributor would like to give fixing the regexes a shot. Marking as easy.
Comment 2 C. Scott Ananian 2014-05-14 17:14:49 UTC
Unfortunately parser changes are never quite so "easy" -- even though the source code change is small, before deployment we need to grep through all our existing wikis to be sure that no one is using RFC links that will be broken.  Perhaps some language wiki uses prefixes for possessives and quite likes the current behavior.  We won't know until we look.

But sure, patch welcome!  Just don't be surprised if it's not immediately committed.  (Oh, and be sure to include parser tests with your patch.)

Source code file name is includes/parser/Parser.php -- here's the code in question:

http://git.wikimedia.org/blob/mediawiki%2Fcore.git/2e50b896f1a55667ced32502caa9681c36df7587/includes%2Fparser%2FParser.php#L1387
Comment 3 Andre Klapper 2014-05-14 18:56:38 UTC
Gotcha. Thanks for elaborating!

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


Navigation
Links