Report de r21806 : Mise a jour de la detection des bots d'apres celle de l'ecran de securite

svn/attic/tags/spip-3.0.18/22011
Cerdic 9 years ago
parent f2510eca15
commit 0302074d8a

@ -83,16 +83,18 @@ if (!defined('_ECRAN_SECURITE')
AND @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php'))
include $f;
if (!defined('_IS_BOT')) {
/**
/*
* Détecteur de robot d'indexation
*
* Utilisé en divers endroits, centralisé ici
*/
if (!defined('_IS_BOT')){
define('_IS_BOT',
isset($_SERVER['HTTP_USER_AGENT'])
AND preg_match(',bot|slurp|crawler|spider|webvac|yandex|INA dlweb|EC2LinkFinder|80legs,i',
$_SERVER['HTTP_USER_AGENT'])
AND preg_match(
// mots generiques
',bot|slurp|crawler|spider|webvac|yandex|'
// UA plus cibles
. '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti'
. ',i', (string)$_SERVER['HTTP_USER_AGENT'])
);
}

Loading…
Cancel
Save