[MediaWiki-commits] [Gerrit] (bug 45669) Fix highly recursive number highlighting regex - change (mediawiki...SyntaxHighlight_GeSHi)
Tim Starling has submitted this change and it was merged. Change subject: (bug 45669) Fix highly recursive number highlighting regex .. (bug 45669) Fix highly recursive number highlighting regex The regular expression used for number highlighting in GeSHi is highly recursive, and easily overflows the low PCRE recursion limit on WMF sites (and, on sites where the recursion limit isn't low, it can easily crash PHP). Fortunately, it's easy to fix for the common case. This is also reported upstream at https://sourceforge.net/p/geshi/bugs/223/ Bug: 45669 Bug: 36839 Change-Id: I27203c767d1d3f2f0999b1b1d8a06e8cf68c19ed --- M geshi/geshi.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Tim Starling: Verified; Looks good to me, approved Mattflaschen: Looks good to me, but someone else must approve diff --git a/geshi/geshi.php b/geshi/geshi.php index 878953e..6074157 100644 --- a/geshi/geshi.php +++ b/geshi/geshi.php @@ -2132,7 +2132,7 @@ } $this->language_data['NUMBERS_RXCACHE'][$key] = - "/(?)($regexp)(?!(?:|(?>[^\<]))+>)(?![^<]*>)(?!\|>)(?!\/>)/i"; // + "/(?)($regexp)(?!(?:|(?>[^\<]+))+>)(?![^<]*>)(?!\|>)(?!\/>)/i"; // } if(!isset($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'])) { -- To view, visit https://gerrit.wikimedia.org/r/58306 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I27203c767d1d3f2f0999b1b1d8a06e8cf68c19ed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi Gerrit-Branch: master Gerrit-Owner: Anomie Gerrit-Reviewer: Mattflaschen Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: Reedy Gerrit-Reviewer: Tim Starling ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 45669) Fix highly recursive number highlighting regex - change (mediawiki...SyntaxHighlight_GeSHi)
Anomie has uploaded a new change for review. https://gerrit.wikimedia.org/r/58306 Change subject: (bug 45669) Fix highly recursive number highlighting regex .. (bug 45669) Fix highly recursive number highlighting regex The regular expression used for number highlighting in GeSHi is highly recursive, and easily overflows the low PCRE recursion limit on WMF sites (and, on sites where the recursion limit isn't low, it can easily crash PHP). Fortunately, it's easy to fix for the common case. This is also reported upstream at https://sourceforge.net/p/geshi/bugs/223/ Bug: 45669 Bug: 36839 Change-Id: I27203c767d1d3f2f0999b1b1d8a06e8cf68c19ed --- M geshi/geshi.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi refs/changes/06/58306/1 diff --git a/geshi/geshi.php b/geshi/geshi.php index 878953e..6074157 100644 --- a/geshi/geshi.php +++ b/geshi/geshi.php @@ -2132,7 +2132,7 @@ } $this->language_data['NUMBERS_RXCACHE'][$key] = - "/(?)($regexp)(?!(?:|(?>[^\<]))+>)(?![^<]*>)(?!\|>)(?!\/>)/i"; // + "/(?)($regexp)(?!(?:|(?>[^\<]+))+>)(?![^<]*>)(?!\|>)(?!\/>)/i"; // } if(!isset($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'])) { -- To view, visit https://gerrit.wikimedia.org/r/58306 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27203c767d1d3f2f0999b1b1d8a06e8cf68c19ed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi Gerrit-Branch: master Gerrit-Owner: Anomie ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits