slitaz-forge annotate pro/index.cgi @ rev 319
graphs.php: avoid an undefined index
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jul 16 12:46:27 2012 +0200 (2012-07-16) |
parents | 99a3dfd92a89 |
children |
rev | line source |
---|---|
pankso@106 | 1 #!/bin/sh |
paul@111 | 2 # Content negotiation for SliTaz Network |
pankso@106 | 3 # |
pankso@106 | 4 |
pankso@106 | 5 IFS="," |
pankso@106 | 6 for lang in $HTTP_ACCEPT_LANGUAGE |
pankso@106 | 7 do |
pankso@106 | 8 lang=${lang%;*} lang=${lang# } lang=${lang%-*} |
pankso@106 | 9 [ -d "$lang" ] && break |
pankso@106 | 10 done |
pankso@106 | 11 unset IFS |
pankso@149 | 12 [ -d "$lang" ] || lang="en" |
pankso@106 | 13 |
pankso@106 | 14 echo "Location: $lang/" |
pankso@106 | 15 echo "" |
pankso@106 | 16 |
pankso@106 | 17 exit 0 |