From 9eae7051bba41668150ef7831f0beaddc2f9230e Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sun, 6 Aug 2006 13:26:06 +0000 Subject: [PATCH] Fix bug due to quote --- html/fiche.php | 4 +-- html/index.php | 2 +- html/login.php | 2 +- include/ac_common.php | 1 + include/fiche_inc.php | 59 ++++++++++++++++++++++----------------- include/postgres.php | 4 +-- include/user_common.php | 1 + include/user_form_fin.php | 5 +++- 8 files changed, 45 insertions(+), 33 deletions(-) diff --git a/html/fiche.php b/html/fiche.php index 44791c3ea..58e868598 100644 --- a/html/fiche.php +++ b/html/fiche.php @@ -134,7 +134,7 @@ if ( isset ($_GET["change_name"] ) ) { echo "

Pas d'accès

"; else { - SaveModeleName($cn,$_GET["fd_id"],$_GET["label"]); + SaveModeleName($cn,$_GET["fd_id"],FormatString($_GET["label"])); UpdateModele($cn,$_GET["fd_id"],$search); } echo ''; @@ -172,7 +172,7 @@ if ( isset ($_POST["update_fiche"]) ) { $a=UpdateFiche($cn,$HTTP_POST_VARS); } $fd_id=GetFicheDef($cn,$_POST["f_id"]); - ViewFiche($cn,$fd_id); + echo ''; diff --git a/html/index.php b/html/index.php index e7b65cba6..33004dcda 100644 --- a/html/index.php +++ b/html/index.php @@ -76,7 +76,7 @@ BODY { -Version 2.0.0 +Version 2.0.1

Il est conseillé de ne PAS utiliser Internet Explorer.

diff --git a/html/login.php b/html/login.php index 408cb8cd8..0da19f49b 100644 --- a/html/login.php +++ b/html/login.php @@ -29,7 +29,7 @@ include_once("debug.php"); if ( isset ($_POST["p_user"] ) ) { echo_debug('login.php',__LINE__,"user is set"); - $g_user=$_POST["p_user"]; + $g_user=FormatString($_POST["p_user"]); $g_pass=$_POST["p_pass"]; $_SESSION['g_user']=$g_user; $_SESSION['g_pass']=$g_pass; diff --git a/include/ac_common.php b/include/ac_common.php index 579ebed5f..58d7aa2c2 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -76,6 +76,7 @@ function cmpDate ($p_date,$p_date_oth) { function isNumber($p_int) { if ( strlen (trim($p_int)) == 0 ) return 0; $p_int=trim($p_int); + $p_int=FormatString($p_int); if (! ereg ("^-{0,1}[0-9]+.{0,1}[0-9]*$",$p_int) ) { return 0; } else { diff --git a/include/fiche_inc.php b/include/fiche_inc.php index 64370a18a..833474575 100644 --- a/include/fiche_inc.php +++ b/include/fiche_inc.php @@ -75,7 +75,7 @@ function AddFiche($p_cn,$p_type,$p_array) { break; } // if account already exist do nothing in tmp_pcmn otherwise add it - if (CountSql($p_cn,"select pcm_val from tmp_pcmn where pcm_val=".${"p_av_text$i"}) == 0 ) + if (CountSql($p_cn,"select pcm_val from tmp_pcmn where pcm_val=".FormatString(${"p_av_text$i"})) == 0 ) { $len=strlen(${"p_av_text$i"})-1; // Mother account @@ -567,7 +567,7 @@ function UpdateFiche($p_cn,$p_array) { if ( $key == 'ad_id'.ATTR_DEF_TVA ) { // is a valid rate ? if ( strlen(trim($element)) == 0 ) continue; - if ( CountSql($p_cn,"select * from tva_rate where tva_id='".$element."'") == 0 ) { + if ( CountSql($p_cn,"select * from tva_rate where tva_id='".FormatString($element)."'") == 0 ) { // warning echo_error('invalid rate') ; echo '