Revision: 5834
          http://ipcop.svn.sourceforge.net/ipcop/?rev=5834&view=rev
Author:   dotzball
Date:     2011-08-28 19:30:53 +0000 (Sun, 28 Aug 2011)
Log Message:
-----------
Check subject texts for non allowed characters and use english text if there 
are some non allowed characters found.

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/email.cgi
    ipcop/trunk/src/scripts/monitorTraffic.pl
    ipcop/trunk/updates/1.9.21/ROOTFILES.i486-1.9.21
    ipcop/trunk/updates/1.9.21/information.xml

Modified: ipcop/trunk/html/cgi-bin/email.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/email.cgi  2011-08-24 15:59:15 UTC (rev 5833)
+++ ipcop/trunk/html/cgi-bin/email.cgi  2011-08-28 19:30:53 UTC (rev 5834)
@@ -107,9 +107,21 @@
         $template .= ".en.tpl";
     }
 
+    my $subject = $Lang::tr{'subject test'};
+
+    unless($subject =~ 
/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_:\.\+,\ 
]+$/) {
+        # found some problematic characters, use english subject text
+        &Lang::reload(2);
+
+        $subject = $Lang::tr{'subject test'};
+
+        # switch back to selected language
+        &Lang::reload(0);
+    }
+
     # send test email
     my $cmd = "/usr/local/bin/emailhelper ";
-    $cmd .= " -s \"$Lang::tr{'subject test'}\" ";
+    $cmd .= " -s \"$subject\" ";
     $cmd .= " -m \"$template\" ";
 
     my $return = `$cmd`;

Modified: ipcop/trunk/src/scripts/monitorTraffic.pl
===================================================================
--- ipcop/trunk/src/scripts/monitorTraffic.pl   2011-08-24 15:59:15 UTC (rev 
5833)
+++ ipcop/trunk/src/scripts/monitorTraffic.pl   2011-08-28 19:30:53 UTC (rev 
5834)
@@ -239,8 +239,17 @@
 
     close(FILE);
 
+    my $subject = $Lang::tr{'subject warn traffic'};
+
+    unless($subject =~ 
/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_:\.\+,\ 
]+$/) {
+        # found some problematic characters, use english subject text
+        &Lang::reload(2);
+        $subject = $Lang::tr{'subject warn traffic'};
+        print "Found problematic character, use english subject text \n" if 
($debugLevel > 0);
+    }
+
     my $cmd = "/usr/local/bin/emailhelper ";
-    $cmd .= " -s \"$Lang::tr{'subject warn traffic'}\" ";
+    $cmd .= " -s \"$subject\" ";
     $cmd .= " -m \"$messagefile\" ";
     $cmd .= " -d ";
 

Modified: ipcop/trunk/updates/1.9.21/ROOTFILES.i486-1.9.21
===================================================================
--- ipcop/trunk/updates/1.9.21/ROOTFILES.i486-1.9.21    2011-08-24 15:59:15 UTC 
(rev 5833)
+++ ipcop/trunk/updates/1.9.21/ROOTFILES.i486-1.9.21    2011-08-28 19:30:53 UTC 
(rev 5834)
@@ -1,7 +1,9 @@
 ## please place IPCop files first, then packages sorted by alphabetical order
 /etc/rc.d/rc.firewall
+/home/httpd/cgi-bin/email.cgi
 /home/httpd/cgi-bin/proxy.cgi
 /usr/local/bin/emailhelper
+/usr/local/bin/monitorTraffic.pl
 /usr/share/locale/tr_TR/LC_MESSAGES/install.mo
 /usr/share/locale/tr_TR/LC_MESSAGES/ipcop.mo
 /var/ipcop/email/templates/test.de.tpl

Modified: ipcop/trunk/updates/1.9.21/information.xml
===================================================================
--- ipcop/trunk/updates/1.9.21/information.xml  2011-08-24 15:59:15 UTC (rev 
5833)
+++ ipcop/trunk/updates/1.9.21/information.xml  2011-08-28 19:30:53 UTC (rev 
5834)
@@ -4,7 +4,7 @@
         <releasedate>2010-mm-dd</releasedate>
         <size>0</size>
         <description>Language updates.&lt;br /&gt;
-        Use utf-8 when sending system email (traffic warning etc.)&lt;br /&gt;
+        Use utf-8 when sending system email (traffic warning etc.).&lt;br /&gt;
         </description>
         <previousversion>1.9.20</previousversion>
         <installdate>INSTALLDATE</installdate>

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to