From fd2e7cbe87468a8a3a9d5b42aa267bbf0a573ccf Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 23 Jan 2007 16:43:44 +0000 Subject: [PATCH] added non_latin flag to dbconnect.php to remove latin rules for UTF8 variables git-svn-id: svn://192.168.202.10@475 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php | 9 +++++++++ agc_2-X/trunk/www/vicidial/admin.php | 4 ++++ agc_2-X/trunk/www/vicidial/dbconnect.php | 1 + 3 files changed, 14 insertions(+) diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index 02ca13ee..93ad481b 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php @@ -575,7 +575,10 @@ $talking_to_print = mysql_num_rows($rslt); } $extension = eregi_replace('Local/',"",$row[0]); $extension = sprintf("%-10s", $extension); + if ($non_latin < 1) + { while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} + } $Luser = $row[1]; $user = sprintf("%-18s", $row[1]); $Lsessionid = $row[2]; @@ -588,12 +591,18 @@ $talking_to_print = mysql_num_rows($rslt); if ($UGdisplay > 0) { $user_group = sprintf("%-12s", $row[9]); + if ($non_latin < 1) + { while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);} + } } if ($UidORname > 0) { $user = sprintf("%-18s", $row[10]); + if ($non_latin < 1) + { while(strlen($user)>18) {$user = substr("$user", 0, -1);} + } } if (!eregi("INCALL|QUEUE",$row[3])) {$call_time_S = ($STARTtime - $row[6]);} diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index f3008ee5..40d529eb 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -516,6 +516,8 @@ if (isset($_GET["auto_alt_dial"])) {$auto_alt_dial=$_GET["auto_alt_dial"];} ##### BEGIN VARIABLE FILTERING FOR SECURITY ##### +if ($non_latin < 1) +{ ### DIGITS ONLY ### $adaptive_dropped_percentage = ereg_replace("[^0-9]","",$adaptive_dropped_percentage); $adaptive_latest_server_time = ereg_replace("[^0-9]","",$adaptive_latest_server_time); @@ -766,6 +768,8 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); ### VARIABLES not filtered at all ### # $script_text +} + ##### END VARIABLE FILTERING FOR SECURITY ##### diff --git a/agc_2-X/trunk/www/vicidial/dbconnect.php b/agc_2-X/trunk/www/vicidial/dbconnect.php index 7221b35e..5247e166 100644 --- a/agc_2-X/trunk/www/vicidial/dbconnect.php +++ b/agc_2-X/trunk/www/vicidial/dbconnect.php @@ -44,5 +44,6 @@ $local_AMP = '@'; $ext_context = 'demo'; $recording_exten = '8309'; $WeBRooTWritablE = '1'; +$non_latin = '0'; # set to 1 for UTF rules ?>