Skip to content

Commit

Permalink
recherche
Browse files Browse the repository at this point in the history
  • Loading branch information
NailaMelhem committed Apr 29, 2015
1 parent 44f4b97 commit 28fa223
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Application/Controllers/Recherche.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public function getAutoCompletion($params) {
$mot=$params['recherche'];
$ou = 'titre'; // $params['ou'];

/*if(!$this->verifierChaine($chaine) ){
if(!$this->verifierChaine($chaine) ){
//caracteres non permis
return $this->setApiResult( [] );
}*/
//$ou=$this->echapper($ou);
}
$ou=$this->echapper($ou);

$modelRecette = new \Application\Models\Recette();
$res=$modelRecette->fetchAllLike($mot, $ou, " ORDER BY $ou LIMIT 0,10 ");
Expand All @@ -62,10 +62,10 @@ public function getRecherche($params) {

if(!$this->verifierChaine($mot) ){
//caracteres non permis
//return $this->setApiResult( [] );
return $this->setApiResult( false, true, 'Vous ne pouvez pas faire cette recherche' );
}

//$ou=$this->echapper($ou);
$ou=$this->echapper($ou);
//echo "<br> ou apres echappe=".$ou."<br>";
$modelViewRecette = new \Application\Models\ViewRecette();
$res=$modelViewRecette->fetchAllLike($mot, $ou, " ORDER BY $ou ");
Expand All @@ -82,7 +82,7 @@ public function getRecherche($params) {


public function verifierChaine($chaine) {
if ($chaine==="." || $chaine===".." || $chaine==="..." ) {
if ($chaine=="." || $chaine==".." || $chaine=="..." ) {
return false;
}
return true;
Expand Down

0 comments on commit 28fa223

Please sign in to comment.