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

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> 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
 
kakashi
posté 15 Dec 2011, 04:18
Message #2


Ceinture blanche OSC
Icône de groupe

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



J'ai progressé un peux, mon url est bien : advanced_search_result.php?x=0&y=0&keywords=baptème&search_in_description=1
mais quand je fais un print_r($_GET) advanced_search_result.php j'ai : baptme

Vous voyez une piste de réflexion à étudier ?


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

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

Portail http://www.clicshopping.org, FAQ http://www.clicshopping.org
Go to the top of the page
 
chti_poupon
posté 15 Dec 2011, 16:13
Message #3


Ceinture noire OSC
Icône de groupe

Groupe : TechDev
Messages : 2757
Inscrit : 9-September 08
Lieu : Douai
Membre no 22915



Bonjour
Code
$url=htmlentities($url)
avant l'appel ne marche pas ?
Chti poupon
Go to the top of the page
 
kakashi
posté 15 Dec 2011, 16:21
Message #4


Ceinture blanche OSC
Icône de groupe

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



Après étude,

cela provient de cette contribution : fwr_media_security_pro.php

et mettre en commentaire :

// Security Pro by FWR Media
include_once (DIR_WS_MODULES . 'security_pro/fwr_media_security_pro.php');
$security_pro = new Fwr_Media_Security_Pro;
// If you need to exclude a file from cleansing then you can add it like below
// $security_pro->addExclusion( 'google_sitemap_products.php' );
$security_pro->cleanse( $PHP_SELF );
// End - Security Pro by FWR Media


L'avez installer, est il possible de faire des retours, avez vous les mêmes problèmes et une solution ?


Ce message a été modifié par kakashi - 15 Dec 2011, 17:42.


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

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

Portail http://www.clicshopping.org, FAQ http://www.clicshopping.org
Go to the top of the page
 
kakashi
posté 15 Dec 2011, 17:42
Message #5


Ceinture blanche OSC
Icône de groupe

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



réponse juste ci dessus


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

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

Portail http://www.clicshopping.org, FAQ http://www.clicshopping.org
Go to the top of the page
 
kakashi
posté 15 Dec 2011, 18:01
Message #6


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
 

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 : 28th March 2024 - 19:10
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)