From fea974d01416c9ecb57f801b1796d1332918063a Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Mon, 23 Jan 2012 09:53:52 -0500 Subject: [PATCH] Fixed: FS#1997 - Check encoding of the subject in ispconfig mail sending function. --- interface/lib/classes/remoting_lib.inc.php | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php index 1310737..9073941 100644 --- a/interface/lib/classes/remoting_lib.inc.php +++ b/interface/lib/classes/remoting_lib.inc.php @@ -536,11 +536,16 @@ if($field['formtype'] == 'PASSWORD') { $sql_insert_key .= "`$key`, "; if($field['encryption'] == 'CRYPT') { - $record[$key] = $app->auth->crypt_password(stripslashes($record[$key])); + $record[$key] = $app->auth->crypt_password(stripslashes($record[$key])); + $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; + } elseif ($field['encryption'] == 'MYSQL') { + $sql_insert_val .= "PASSWORD('".$app->db->quote($record[$key])."'), "; + } elseif ($field['encryption'] == 'CLEARTEXT') { + $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; } else { - $record[$key] = md5($record[$key]); + $record[$key] = md5(stripslashes($record[$key])); + $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; } - $sql_insert_val .= "'".$record[$key]."', "; } elseif ($field['formtype'] == 'CHECKBOX') { $sql_insert_key .= "`$key`, "; if($record[$key] == '') { @@ -645,7 +650,7 @@ foreach($primary_id as $key => $val) { $key = $app->db->quote($key); $val = $app->db->quote($val); - if(strpos($val,'%')) { + if(stristr($val,'%')) { $sql_where .= "$key like '$val' AND "; } else { $sql_where .= "$key = '$val' AND "; -- Gitblit v1.9.1