Item9840: SUBST removes everything after last match if there is a newline after the match

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: FilterPlugin
Branches:
Reported By: ErikJohansson
Waiting For:
Last Change By: MichaelDaum
FilterPlugin does not handle replacement when the text after the last match contains newlines.

Take the following replacement
%STARTSUBST%{pattern="b" format="B"}abc
xyz%STOPSUBST%

The expected outcome is:
aBc
xyz

The real outcome is:
aB

The patch below would probably fix it:
--- Core.pm~ 2010-10-18 13:57:06.392634612 +0200
+++ Core.pm  2010-10-18 15:38:17.711511441 +0200
@@ -214,7 +214,7 @@
       $hits--;
       last if $theLimit > 0 && $hits <= 0;
     }
-    if ($text =~ /\G(.*)$/) {
+    if ($text =~ /\G(.*)$/s) {
       $result .= $1;
     }
   }

-- ErikJohansson - 18 Oct 2010

Fix released in 2.04

-- MichaelDaum - 06 Apr 2011

ItemTemplate edit

Summary SUBST removes everything after last match if there is a newline after the match
ReportedBy ErikJohansson
Codebase trunk
SVN Range
AppliesTo Extension
Component FilterPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins FilterPlugin:b92ef3cd6cd8 FilterPlugin:47852443b5a8
TargetRelease n/a
ReleasedIn n/a
Topic revision: r2 - 06 Apr 2011, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy