Écrit par : kakashi 14 Dec 2011, 19:00
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
Écrit par : kakashi 15 Dec 2011, 04:18
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 ?
Écrit par : chti_poupon 15 Dec 2011, 16:13
Bonjour
Code
$url=htmlentities($url)
avant l'appel ne marche pas ?
Chti poupon
Écrit par : kakashi 15 Dec 2011, 16:21
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 ?
Écrit par : kakashi 15 Dec 2011, 18:01
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 );
}