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] =
-                    
"/(?<!<\|\/)(?<!<\|!REG3XP)(?<!<\|\/NUM!)(?<!\d\/>)($regexp)(?!(?:<DOT>|(?>[^\<]))+>)(?![^<]*>)(?!\|>)(?!\/>)/i";
 //
+                    
"/(?<!<\|\/)(?<!<\|!REG3XP)(?<!<\|\/NUM!)(?<!\d\/>)($regexp)(?!(?:<DOT>|(?>[^\<]+))+>)(?![^<]*>)(?!\|>)(?!\/>)/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 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to