NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item11383 for general documentation changes for release 1.1.5. Use Item9693 for docu changes for release 2.0.

Item9342: does not work with VirtualHostingContrib

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Enhancement Closed Extension MailerContrib  
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 Foswikirev:9181 Foswikirev:9182
TargetRelease patch
ReleasedIn 1.0.10
Topic revision: r5 - 27 Sep 2010 - 19:54:05 - KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads