Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1690 → Rev 1691

/trunk/jrest/services/Coel.php
47,7 → 47,7
// Nettoyage du $_GET (sécurité)
if (isset($_GET)) {
$get_params = array('orderby', 'distinct', 'start', 'limit', 'formatRetour');
$get_params = array('orderby', 'distinct', 'start', 'limit', 'formatRetour', 'searchCity');
foreach ($get_params as $get) {
$verifier = array('NULL', "\n", "\r", "\\", "'", '"', "\x00", "\x1a", ';');
if (isset($_GET[$get]) && $_GET[$get] != '') {
/trunk/jrest/services/CoelStructure.php
68,8 → 68,14
$whereClause = array();
if(isset($p['id_projet'])) $whereClause[] = "cs_ce_projet = {$p['id_projet']}";
if(isset($p['id_structure'])) $whereClause[] = "cs_id_structure = {$p['id_structure']}";
if(isset($p['recherche'])) $whereClause[] = "(" . implode(" OR ", array("cs_nom LIKE {$p['recherche']}", "cs_ville LIKE {$p['recherche']}")) . ")";
 
if(isset($p['recherche'])) {
if(@$this->searchCity && trim($this->searchCity) == true) {
$whereClause[] = "(" . implode(" OR ", array("cs_nom LIKE {$p['recherche']}", "cs_ville LIKE {$p['recherche']}")) . ")";
} else {
$whereClause[] = "cs_nom LIKE {$p['recherche']}";
}
}
 
// Construction de la requête
$requete = sprintf(