From 759db54cc2972f131d7673c833df80694f8baf5b Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 24 Mar 2010 13:42:37 +0000 Subject: [PATCH] Correctly handle followed by ISBN Bug 22905. Patch based on one submitted by Solitarius. Basically, we were assuming that anything matching was a link and ignoring it so as to avoid nested links, but that matched the HTML from (fr) ISBN 2753300917 [http://www.example.com example.com] so the ISBN didn't work. Parser test committed, fails without the Parser.php change. --- CREDITS | 1 + RELEASE-NOTES | 1 + includes/parser/Parser.php | 2 +- maintenance/parserTests.txt | 9 +++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index a07930a919..a4c38ad2dd 100644 --- a/CREDITS +++ b/CREDITS @@ -115,6 +115,7 @@ following names for their contribution to the product. * ST47 * Scott Colcord * Simon Walker +* Solitarius * Stefano Codari * Str4nd * svip diff --git a/RELEASE-NOTES b/RELEASE-NOTES index dc456145b5..f3a1ec6416 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -55,6 +55,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 18664) Relative URIs in interwiki links cause failed redirects * (bug 19270) Relative URIs in interwiki links break interwiki transclusion * (bug 22903) Revdelete log entries now show in the user preferred language. +* (bug 22905) Correctly handle followed by ISBN == API changes in 1.17 == * (bug 22738) Allow filtering by action type on query=logevent diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 9260a8061f..3b6d6134ac 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -970,7 +970,7 @@ class Parser $urlChar = self::EXT_LINK_URL_CLASS; $text = preg_replace_callback( '!(?: # Start cases - () | # m[1]: Skip link text + (].*?) | # m[1]: Skip link text (<.*?>) | # m[2]: Skip stuff inside HTML elements' . " (\\b(?:$prots)$urlChar+) | # m[3]: Free external links" . ' (?:RFC|PMID)\s+([0-9]+) | # m[4]: RFC or PMID, capture number diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 544b1f69b5..aed2f053bd 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -6498,6 +6498,15 @@ ISBN ISBN 1234567890

!! end +!! test +Bug 22905: followed by ISBN followed by +!! input +(fr) ISBN 2753300917 [http://www.example.com example.com] +!! result +

(fr) ISBN 2753300917 example.com +

+!! end + !! test Double RFC !! input -- 2.20.1