/[openfoncier]/branches/3.14.0-b13/obj/utils.class.php
ViewVC logotype

Diff of /branches/3.14.0-b13/obj/utils.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3189 by vpihour, Fri Nov 28 16:46:53 2014 UTC revision 3205 by vpihour, Fri Dec 12 17:18:40 2014 UTC
# Line 77  class utils extends application { Line 77  class utils extends application {
77                            
78              // Récupération des infos utilisateur              // Récupération des infos utilisateur
79              $sqlUser = "SELECT om_utilisateur, nom, email, login, om_collectivite, om_profil ".              $sqlUser = "SELECT om_utilisateur, nom, email, login, om_collectivite, om_profil ".
80              "FROM ".DB_PREFIXE."om_utilisateur WHERE login = '".$_SESSION['login']."'";              "FROM ".DB_PREFIXE."om_utilisateur WHERE login = '".$this->clean_break($_SESSION['login'])."'";
81              $resUser=$this->db->query($sqlUser);              $resUser=$this->db->query($sqlUser);
82              $this->addToLog("getUserInfos(): db->query(\"".$sqlUser."\");", VERBOSE_MODE);              $this->addToLog("getUserInfos(): db->query(\"".$sqlUser."\");", VERBOSE_MODE);
83              if ( database::isError($resUser)){              if ( database::isError($resUser)){
# Line 1096  class utils extends application { Line 1096  class utils extends application {
1096          //          //
1097          return false;          return false;
1098      }      }
1099        
1100        function clean_break($input) {
1101            //remove whitespace...
1102            $input = trim($input);
1103            //disable magic quotes...
1104            $input = get_magic_quotes_gpc() ? stripslashes($input) : $input;
1105            //prevent sql injection...
1106            $input = is_numeric($input) ? intval($input) : $this->db->escapeSimple($input);
1107            //prevent xss...
1108            $input = htmlentities($input);
1109            return $input;
1110        }
1111  }  }
1112    
1113  ?>  ?>

Legend:
Removed from v.3189  
changed lines
  Added in v.3205

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26