slitaz-forge view boot/index.php @ rev 712

Prevent sending the Referer header
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Aug 20 08:44:15 2020 +0000 (2020-08-20)
parents
children
line source
1 <?php
2 foreach (explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]) as $lang) {
3 foreach (array(';',' ','-') as $char) {
4 if (($n = strpos($lang, $char)) !== false)
5 $lang = substr($lang,0,$n);
6 }
7 if (is_dir($lang)) break;
8 $lang = "en";
9 }
10 header("Location: $lang/");
11 ?>