[Fusionforge-commits] r14769 - trunk/src/common/mail

Alain Peyrat aljeux at fusionforge.org
Wed Nov 9 14:04:45 CET 2011


Author: aljeux
Date: 2011-11-09 14:04:44 +0100 (Wed, 09 Nov 2011)
New Revision: 14769

Modified:
   trunk/src/common/mail/MailingList.class.php
Log:
More controls in MailingList.class.

Modified: trunk/src/common/mail/MailingList.class.php
===================================================================
--- trunk/src/common/mail/MailingList.class.php	2011-11-09 10:03:55 UTC (rev 14768)
+++ trunk/src/common/mail/MailingList.class.php	2011-11-09 13:04:44 UTC (rev 14769)
@@ -122,6 +122,10 @@
 		}
 
 		$realListName = strtolower($this->Group->getUnixName().'-'.$listName);
+		if (!preg_match('/^[a-z0-9\-_\.]*$/', $realListName)) {
+			$this->setError(_('Invalid List Name') . ': ' .$realListName);
+			return false;
+		}
 
 		// '|' or '/' are valid chars in emails but are not allowed by mailman.
 		if( preg_match('/[|\/]/', $realListName) ||
@@ -386,6 +390,10 @@
 			$this->setPermissionDeniedError();
 			return false;
 		}
+		if (!$this->getID() || !$this->getName()) {
+			$this->setError('ID or Name null in MailingList object');
+			return false;
+		}
 		$res = db_query_params ('INSERT INTO deleted_mailing_lists (mailing_list_name,delete_date,isdeleted) VALUES ($1,$2,$3)',
 					array ($this->getName(),
 					       time(),




More information about the Fusionforge-commits mailing list