From 46e44572dfc610b989c80d92d9ee83868c950966 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sun, 14 Aug 2005 22:11:15 +0000 Subject: [PATCH] Remove eval from ldap version, too --- phpgwapi/inc/class.contacts_ldap.inc.php | 20 ++++++++++++++++---- phpgwapi/inc/class.contacts_sql.inc.php | 10 ++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/phpgwapi/inc/class.contacts_ldap.inc.php b/phpgwapi/inc/class.contacts_ldap.inc.php index a4a654744b..8736899a8e 100644 --- a/phpgwapi/inc/class.contacts_ldap.inc.php +++ b/phpgwapi/inc/class.contacts_ldap.inc.php @@ -209,7 +209,10 @@ $one_type = $return_fields[0]['adr_one_type']; foreach($this->adr_types as $name => $val) { - eval("if(strstr(\$one_type,\$name)) { \$return_fields[0][\"one_\$name\"] = \"on\"; }"); + if(strstr($one_type,$name)) + { + $return_fields[0]['one_'.$name] = 'on'; + } } } if($return_fields[0]['adr_two_type']) @@ -217,7 +220,10 @@ $two_type = $return_fields[0]['adr_two_type']; foreach($this->adr_types as $name => $val) { - eval("if(strstr(\$two_type,\$name)) { \$return_fields[0][\"two_\$name\"] = \"on\"; }"); + if (strstr($two_type,$name)) + { + $return_fields[0]['two_'.$name] = 'on'; + } } } @@ -281,7 +287,10 @@ $one_type = $return_fields[0]['adr_one_type']; foreach($this->adr_types as $name => $val) { - eval("if(strstr(\$one_type,\$name)) { \$return_fields[0][\"one_\$name\"] = \"on\"; }"); + if(strstr($one_type,$name)) + { + $return_fields[0]['one_'.$name] = 'on'; + } } } if($return_fields[0]['adr_two_type']) @@ -289,7 +298,10 @@ $two_type = $return_fields[0]['adr_two_type']; foreach($this->adr_types as $name => $val) { - eval("if(strstr(\$two_type,\$name)) { \$return_fields[0][\"two_\$name\"] = \"on\"; }"); + if (strstr($two_type,$name)) + { + $return_fields[0]['two_'.$name] = 'on'; + } } } diff --git a/phpgwapi/inc/class.contacts_sql.inc.php b/phpgwapi/inc/class.contacts_sql.inc.php index 8beb77080d..5d2a6d6a89 100644 --- a/phpgwapi/inc/class.contacts_sql.inc.php +++ b/phpgwapi/inc/class.contacts_sql.inc.php @@ -213,7 +213,10 @@ $one_type = $this->db->f('adr_one_type'); foreach($this->adr_types as $name => $val) { - if (strstr($one_type,$name)) $return_fields[0]['one_'.$name] = 'on'; + if (strstr($one_type,$name)) + { + $return_fields[0]['one_'.$name] = 'on'; + } } } if ($this->db->f('adr_two_type')) @@ -221,7 +224,10 @@ $two_type = $this->db->f('adr_two_type'); foreach($this->adr_types as $name => $val) { - if (strstr($two_type,$name)) $return_fields[0]['two_'.$name] = 'on'; + if (strstr($two_type,$name)) + { + $return_fields[0]['two_'.$name] = 'on'; + } } }