php - How to validate HTTP_ACCEPT_LANGUAGE? -
php - How to validate HTTP_ACCEPT_LANGUAGE? -
since script gets $_server['http_accept_language']
visitor anything. how can validate it? acceptable?
to first language within string use:
substr($_server["http_accept_language"],0,2)
for example
$user_lang= split(",",$_server["http_accept_language"]); $language = $user_lang[0]; // header injection. if(stripos($language, 'content-type') !== false ) { exit; }
php
Comments
Post a Comment