mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 16:25:56 +00:00
initial WIP for php8; bump php version requirement to 7.0
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* accept-to-gettext.inc -- convert information in 'Accept-*' headers to
|
||||
* gettext language identifiers.
|
||||
* Copyright (c) 2003, Wouter Verhelst <wouter@debian.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -33,7 +33,7 @@
|
||||
* Note that this will send out header information (to be
|
||||
* RFC2616-compliant), so it must be called before anything is sent to
|
||||
* the user.
|
||||
*
|
||||
*
|
||||
* Assumptions made:
|
||||
* * Charset encodings are written the same way as the Accept-Charset
|
||||
* HTTP header specifies them (RFC2616), except that they're parsed
|
||||
@@ -46,13 +46,13 @@
|
||||
* used. "en.ISO-8859-15" is OK, though.
|
||||
* * The language is more important than the charset; i.e., if the
|
||||
* following is given:
|
||||
*
|
||||
*
|
||||
* Accept-Language: nl-be, nl;q=0.8, en-us;q=0.5, en;q=0.3
|
||||
* Accept-Charset: ISO-8859-15, utf-8;q=0.5
|
||||
*
|
||||
* And the supplied parameter contains (amongst others) nl_BE.UTF-8
|
||||
* and nl.ISO-8859-15, then nl_BE.UTF-8 will be picked.
|
||||
*
|
||||
*
|
||||
* $Log: accept-to-gettext.inc,v $
|
||||
* Revision 1.1.1.1 2003/11/19 19:31:15 wouter
|
||||
* * moved to new CVS repo after death of the old
|
||||
@@ -93,7 +93,7 @@ function al2gt($gettextlangs, $mime) {
|
||||
$_SERVER["HTTP_ACCEPT_CHARSET"]);
|
||||
$alparts=@preg_split("/,/",$acceptLang);
|
||||
$acparts=@preg_split("/,/",$acceptChar);
|
||||
|
||||
|
||||
/* Parse the contents of the Accept-Language header.*/
|
||||
foreach($alparts as $part) {
|
||||
$part=trim($part);
|
||||
@@ -112,7 +112,7 @@ function al2gt($gettextlangs, $mime) {
|
||||
* all character sets not explicitly mentioned get a quality value of
|
||||
* 0, except for ISO-8859-1, which gets a quality value of 1 if not
|
||||
* explicitly mentioned.''
|
||||
*
|
||||
*
|
||||
* Making it 2 for the time being, so that we
|
||||
* can distinguish between "not specified" and "specified as 1" later
|
||||
* on. */
|
||||
@@ -132,7 +132,7 @@ function al2gt($gettextlangs, $mime) {
|
||||
$acscores["ISO-8859-1"]=(isset($acscores["*"])?$acscores["*"]:1);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Loop through the available languages/encodings, and pick the one
|
||||
* with the highest score, excluding the ones with a charset the user
|
||||
* did not include.
|
||||
@@ -171,7 +171,7 @@ function al2gt($gettextlangs, $mime) {
|
||||
|
||||
/* We must re-parse the gettext-string now, since we may have found it
|
||||
* through a "*" qualifier.*/
|
||||
|
||||
|
||||
$gtparts=@preg_split("/\./",$curgtlang);
|
||||
$tmp=strtolower($gtparts[0]);
|
||||
$lang=preg_replace("/\_/", "-", $tmp);
|
||||
|
||||
Reference in New Issue
Block a user