[Fusionforge-commits] r14711 - in trunk/src: common/include www/soap/tracker

Alain Peyrat aljeux at fusionforge.org
Wed Oct 26 09:29:26 CEST 2011


Author: aljeux
Date: 2011-10-26 09:29:25 +0200 (Wed, 26 Oct 2011)
New Revision: 14711

Modified:
   trunk/src/common/include/utils.php
   trunk/src/www/soap/tracker/tracker.php
Log:
Strip unprintable chars in SOAP tracker

Modified: trunk/src/common/include/utils.php
===================================================================
--- trunk/src/common/include/utils.php	2011-10-26 07:29:19 UTC (rev 14710)
+++ trunk/src/common/include/utils.php	2011-10-26 07:29:25 UTC (rev 14711)
@@ -90,6 +90,18 @@
     return true;
 }
 
+function util_strip_unprintable(&$data) {
+	if (is_array($data)) {
+		foreach ($data as $key => &$value) {
+			util_strip_unprintable($value);
+		}
+	}
+	else {
+		$data = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/', '', $data);
+	}
+	return $data;
+}
+
 /**
  * removeCRLF() - remove any Carriage Return-Line Feed from a string.
  * That function is useful to remove the possibility of a CRLF Injection when sending mail

Modified: trunk/src/www/soap/tracker/tracker.php
===================================================================
--- trunk/src/www/soap/tracker/tracker.php	2011-10-26 07:29:19 UTC (rev 14710)
+++ trunk/src/www/soap/tracker/tracker.php	2011-10-26 07:29:25 UTC (rev 14711)
@@ -734,7 +734,7 @@
 	if ($artifacts === false) {
 		return new soap_fault ('','getArtifacts',$af->getErrorMessage(),$af->getErrorMessage());
 	}
-	return artifacts_to_soap($artifacts);
+	return util_strip_unprintable(artifacts_to_soap($artifacts));
 
 }
 




More information about the Fusionforge-commits mailing list