/[openfoncier]/branches/3.14.x/obj/utils.class.php
ViewVC logotype

Diff of /branches/3.14.x/obj/utils.class.php

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

revision 3479 by vpihour, Thu Mar 26 18:02:05 2015 UTC revision 3480 by nhaye, Tue May 19 14:56:17 2015 UTC
# Line 1097  class utils extends application { Line 1097  class utils extends application {
1097          //          //
1098          return false;          return false;
1099      }      }
1100    
1101        /**
1102         * XXX Méthode à supprimer après que les externals du core soient dé-fixé
1103         *
1104         * Méthode de prévention des failles de sécurités en nettoyant les variables
1105         * passées en paramètre.
1106         *
1107         * @param mixed $input valeurs à netoyer
1108         *
1109         * @return mixed valeurs nétoyées
1110         */
1111        function clean_break($input) {
1112            if(is_array($input)) {
1113                foreach($input as $key => $value) {
1114                    $input[$key] = $this->clean_break($value);
1115                }
1116            } else {
1117                //remove whitespace...
1118                $input = trim($input);
1119                //disable magic quotes...
1120                if(get_magic_quotes_gpc()) {
1121                    stripslashes($input);
1122                }
1123                //prevent sql injection...
1124                if(!is_numeric($input)) {
1125                    if(isset($this->db)) {
1126                        $this->db->escapeSimple($input);
1127                    }
1128                }
1129                //prevent xss...
1130                $input = strip_tags($input);
1131            }
1132            return $input;
1133        }
1134  }  }
1135    
1136  ?>  ?>

Legend:
Removed from v.3479  
changed lines
  Added in v.3480

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26