Commit MetaInfo

Revisionb342c1e787bf0d86aea9c24b5f2aebdb5692498a (tree)
Zeit2015-03-25 02:35:54
Autorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack2/358 Improve note regex for better PHP compatibility

PHP5.3 (and others) sometimes crash with long note body.
So we reduce regex computational complexity by using '(('
Positive assertion and Once-only subpattern '(?='.

Ändern Zusammenfassung

Diff

--- a/lib/make_link.php
+++ b/lib/make_link.php
@@ -287,7 +287,7 @@ class Link_note extends Link
287287 {
288288 return <<<EOD
289289 \(\(
290- ((?:(?R)|(?!\)\)).)*) # (1) note body
290+ ((?>(?=\(\()(?R)|(?!\)\)).)*) # (1) note body
291291 \)\)
292292 EOD;
293293 }
Show on old repository browser