Item9342: does not work with VirtualHostingContrib

pencil
Priority: Enhancement
Current State: Closed
Released In: 1.0.10
Target Release: patch
Applies To: Extension
Component: MailerContrib
Branches:
Reported By: AntonioTerceiro
Waiting For:
Last Change By: KennethLavrsen
Hi,

MailerContrib currently does not work with VirtualHostingContrib's wrapper script because regular expressions in Foswiki::Contrib::MailerContrib::WebNotify use the o modifier, what causes them to be compiled only once. Please see the developer documentation for developers in VirtualHostingContrib for more details.

I propose the following change to fix that (i.e. just remove the 'o' modifier from the regular expressions):

Index: MailerContrib/lib/Foswiki/Contrib/MailerContrib/WebNotify.pm
===================================================================
--- MailerContrib/lib/Foswiki/Contrib/MailerContrib/WebNotify.pm (revision 8210)
+++ MailerContrib/lib/Foswiki/Contrib/MailerContrib/WebNotify.pm (working copy)
@@ -363,13 +363,13 @@
 
     # join \ terminated lines
     $text =~ s/\\\r?\n//gs;
-    my $webRE = qr/(?:$Foswiki::cfg{UsersWebName}\.)?/o;
+    my $webRE = qr/(?:$Foswiki::cfg{UsersWebName}\.)?/;
     foreach my $baseline ( split( /\r?\n/, $text ) ) {
         my $line =
           Foswiki::Func::expandCommonVariables( $baseline, $this->{topic},
             $this->{web}, $meta );
         if ( $line =~
-/^\s+\*\s$webRE($Foswiki::regex{wikiWordRegex})\s+\-\s+($Foswiki::cfg{MailerContrib}{EmailFilterIn}+)\s*$/o
+/^\s+\*\s$webRE($Foswiki::regex{wikiWordRegex})\s+\-\s+($Foswiki::cfg{MailerContrib}{EmailFilterIn}+)\s*$/
             && $1 ne $Foswiki::cfg{DefaultUserWikiName} )
         {
 
@@ -378,7 +378,7 @@
             $in_pre = 0;
         }
         elsif ( $line =~
-/^\s+\*\s$webRE($Foswiki::regex{wikiWordRegex}|'.*?'|".*?"|$Foswiki::cfg{MailerContrib}{EmailFilterIn})\s*(:.*)?$/o
+/^\s+\*\s$webRE($Foswiki::regex{wikiWordRegex}|'.*?'|".*?"|$Foswiki::cfg{MailerContrib}{EmailFilterIn})\s*(:.*)?$/
             && $1 ne $Foswiki::cfg{DefaultUserWikiName} )
         {
             my $subscriber = $1;

There will be a small performance hit, but IMO being able to use MailerContrib together with VirtualHostingContrib pays off.

-- AntonioTerceiro - 16 Jul 2010

 

ItemTemplate edit

Summary does not work with VirtualHostingContrib
ReportedBy AntonioTerceiro
Codebase 1.0.10, 1.0.9, trunk
SVN Range
AppliesTo Extension
Component MailerContrib
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins distro:0dc8285899eb distro:e475dac55780
TargetRelease patch
ReleasedIn 1.0.10
Topic revision: r5 - 27 Sep 2010, KennethLavrsen
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