note 126809 added to locale.acceptfromhttp
| From: | bohwaz at main dot php dot net | Date: | Fri, 28 Jan 2022 11:26:45 +0000 |
| Subject: | note 126809 added to locale.acceptfromhttp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217553@lists.php.net to get a copy of this message | ||
Please note that this method can throw IntlException in some cases when the passed header string is
invalid AND you have enabled exceptions. For example:
<?php
ini_set('intl.use_exceptions', 1);
$header =
'fr-FR,fr;q=0.9,fr;q=0.9;q=0.8,en-gb;q=0.8;q=0.7,en;q=0.6,en;q=0.7;q=0.5,*;q=0.5;q=0.4';
var_dump(locale_accept_from_http($header));
?>
Returns:
PHP Warning: Uncaught IntlException: locale_accept_from_http: failed to
find acceptable locale in ...
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 193.57.121.137)
----
Manual Page -- https://php.net/manual/en/locale.acceptfromhttp.php
Edit -- https://main.php.net/note/edit/126809
Del: integrated -- https://main.php.net/note/delete/126809/integrated
Del: useless -- https://main.php.net/note/delete/126809/useless
Del: bad code -- https://main.php.net/note/delete/126809/bad+code
Del: spam -- https://main.php.net/note/delete/126809/spam
Del: non-english -- https://main.php.net/note/delete/126809/non-english
Del: in docs -- https://main.php.net/note/delete/126809/in+docs
Del: other reasons-- https://main.php.net/note/delete/126809
Reject -- https://main.php.net/note/reject/126809
Search -- https://main.php.net/manage/user-notes.php