osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

> Suppression de é ou è lors d'une recherche [résolu], Ou trouver le pb ?
kakashi
posté 14 Dec 2011, 19:00
Message #1


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 28-October 10
Membre no 28192



J'ai un petit problème, lorsque je mets baptème dans la boxe recherche, il me supprime tous les è

mon url s'écrit donc : advanced_search_result.php?x=0&y=0&keywords=baptème&search_in_description=1
mais dans ma boxe recherche : cela s'écrit : baptme

===> Conclusion il me recherche rien.

par contre si je mets un è dans l'url en remplacant è, alors je retrouve mon résultat de recherche.

mon url s'écrit donc : advanced_search_result.php?x=0&y=0&keywords=baptème&search_in_description=1

Avez vous une idée, des piste de recherche dans les fonctions ?

merci de votre aide

Ce message a été modifié par kakashi - 15 Dec 2011, 18:02.


--------------------
Cordialement

-------------------

Portail http://www.clicshopping.org, FAQ http://www.clicshopping.org
Go to the top of the page
 
 
Start new topic
Réponse(s)
kakashi
posté 15 Dec 2011, 18:01
Message #2


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 28-October 10
Membre no 28192



voila la solution !

Code
/*
  function spro_cleanse_get_recursive( $get ) {
    if ( !is_array( $get ) ) {
      $banned_string_pattern = '@GLOBALS|_REQUEST|base64_encode|UNION|%3C|%3E@i';
      // Apply the whitelist
      $cleansed = preg_replace( "/[^\s{}a-z0-9_\.\-]/i", "", urldecode( $get ) );
      // Remove banned words
      $cleansed = preg_replace( $banned_string_pattern, '', $cleansed );
      // Ensure that a clever hacker hasn't gained himself a naughty double hyphen -- after our cleansing
      return preg_replace( '@[-]+@', '-', $cleansed );
    }
    // Add the preg_replace to every element.
    return array_map( 'spro_cleanse_get_recursive', $get );
  }
*/  
function spro_cleanse_get_recursive( $get ) {
        /**
        * IMPORTANT - DO NOT use the below to gimp the whitelist, this should be used for valid language special characters only
        *
        * @example $lang_additions = 'åÅäÄöÖ';
        * @var string - Valid language special characters to be added to the whitelist
        */    
//        $lang_additions = utf8_decode('àâäæàçèêëîœôôùûÀÂÂÆÇÈÉÊËÎÏŒÔÙÛüÿ'); // Special language characters go here - see the example above
        $lang_additions = 'àâäæàçèéêëîœôôùûÀÂÂÆÇÈÉÊËÎÏŒÔÙÛüÿ'; // Special language characters go here - see the example above

        if ( !is_array( $get ) ) {
        $banned_string_pattern = '@GLOBALS|_REQUEST|base64_encode|UNION|%3C|%3E@i';
        // Apply the whitelist
        $pattern = "/[^\s{}a-z0-9_\.\-" . $lang_additions . "]/i";
        $cleansed = preg_replace( $pattern, "", urldecode( $get ) );
        // Remove banned words
        $cleansed = preg_replace( $banned_string_pattern, '', $cleansed );
        // Ensure that a clever hacker hasn't gained himself a naughty double hyphen -- after our cleansing
        return preg_replace( '@[-]+@', '-', $cleansed );
        }
        // Add the preg_replace to every element.
        return array_map( 'spro_cleanse_get_recursive', $get );
  }


--------------------
Cordialement

-------------------

Portail http://www.clicshopping.org, FAQ http://www.clicshopping.org
Go to the top of the page
 

Les messages de ce sujet


Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 29th March 2024 - 07:59
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)