gunnar: server/kolab-webadmin/kolab-webadmin/lib/KolabAdmin/Sieve Segment.php, 1.5, 1.6
cvs at kolab.org
cvs at kolab.org
Wed Apr 7 08:14:40 CEST 2010
Author: gunnar
Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/lib/KolabAdmin/Sieve
In directory doto:/tmp/cvs-serv29327/kolab-webadmin/lib/KolabAdmin/Sieve
Modified Files:
Segment.php
Log Message:
Full escaping of deactivated script segments.
Index: Segment.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/lib/KolabAdmin/Sieve/Segment.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Segment.php 6 Apr 2010 17:47:34 -0000 1.5
+++ Segment.php 7 Apr 2010 06:14:38 -0000 1.6
@@ -95,10 +95,19 @@
public function generate()
{
+ $script = $this->_generateScript();
+ if (!$this->_active) {
+ $script = preg_replace('/^(.)/m', '#$1', $script);
+ }
return '### SEGMENT START ' . strtoupper($this->type) .' ' .
(($this->_active) ? 'ENABLED' : 'DISABLED') . "\r\n" .
- vsprintf($this->template, $this->getArguments()) .
+ $script .
'### SEGMENT END ' . strtoupper($this->type) . "\r\n";
+ }
+
+ private function _generateScript()
+ {
+ return vsprintf($this->template, $this->getArguments());
}
protected function dotstuff($str)
More information about the commits
mailing list