summaryrefslogtreecommitdiff
path: root/lib/accept-to-gettext.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-01-21 23:06:35 +0300
committerAndrew Dolgov <[email protected]>2017-01-21 23:06:35 +0300
commit0047f2578f126cb6de2eed928e86ed7340c3854d (patch)
treef0232c896bfd89b4ff5d9f57402cb14c9693660d /lib/accept-to-gettext.php
parent6be7fe00aeb5f7dbed1f6ed6fd84f316032cfa0a (diff)
parent566e8574fb4fe2325069625557eb34e8f619c2e4 (diff)
Merge branch 'lib-upgrades' into 'master'
Third-party library upgrades * lib: Upgrade php-gettext from 1.0.11 to 1.0.12 * lib: Upgrade accept-to-gettext.php from 2003-08-14 to 2007-04-01 * lib: Upgrade JShrink from 0.5.1 to 1.1.0 * lib: Upgrade mobile-detect from svn r44 (2012-05-03) to 2.8.24 (2016-11-11) * lib: Upgrade php-publisher from ??? to a5d6a0e (2016-11-15) * lib: Upgrade php-subscriber from ??? to 1213f89 (2016-11-15) * lib: Upgrade script.aculo.us from 1.8.3 to 1.9.0 * lib: Upgrade timezones.txt from 2010k/l/m/n/2011a to 2016j See merge request !40
Diffstat (limited to 'lib/accept-to-gettext.php')
-rw-r--r--lib/accept-to-gettext.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/accept-to-gettext.php b/lib/accept-to-gettext.php
index 6f366d06a..c909497cb 100644
--- a/lib/accept-to-gettext.php
+++ b/lib/accept-to-gettext.php
@@ -63,6 +63,8 @@
* Revision 1.2 2003/08/14 10:23:59 wouter
* Removed little error in Content-Type header syntaxis.
*
+ * 2007-04-01
+ * add '@' before use of arrays, to avoid PHP warnings.
*/
/* not really important, this one; perhaps I could've put it inline with
@@ -86,9 +88,9 @@ function find_match($curlscore,$curcscore,$curgtlang,$langval,$charval,
function al2gt($gettextlangs, $mime) {
/* default to "everything is acceptable", as RFC2616 specifies */
$acceptLang=(($_SERVER["HTTP_ACCEPT_LANGUAGE"] == '') ? '*' :
- $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
+ $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
$acceptChar=(($_SERVER["HTTP_ACCEPT_CHARSET"] == '') ? '*' :
- $_SERVER["HTTP_ACCEPT_CHARSET"]);
+ $_SERVER["HTTP_ACCEPT_CHARSET"]);
$alparts=@preg_split("/,/",$acceptLang);
$acparts=@preg_split("/,/",$acceptChar);
@@ -147,22 +149,22 @@ function al2gt($gettextlangs, $mime) {
$noct=@preg_split("/-/",$allang);
$testvals=array(
- array($alscores[$allang], $acscores[$gtcs]),
- array($alscores[$noct[0]], $acscores[$gtcs]),
- array($alscores[$allang], $acscores["*"]),
- array($alscores[$noct[0]], $acscores["*"]),
- array($alscores["*"], $acscores[$gtcs]),
- array($alscores["*"], $acscores["*"]));
+ array(@$alscores[$allang], @$acscores[$gtcs]),
+ array(@$alscores[$noct[0]], @$acscores[$gtcs]),
+ array(@$alscores[$allang], @$acscores["*"]),
+ array(@$alscores[$noct[0]], @$acscores["*"]),
+ array(@$alscores["*"], @$acscores[$gtcs]),
+ array(@$alscores["*"], @$acscores["*"]));
$found=FALSE;
foreach($testvals as $tval) {
if(!$found && isset($tval[0]) && isset($tval[1])) {
$arr=find_match($curlscore, $curcscore, $curgtlang, $tval[0],
- $tval[1], $gtlang);
+ $tval[1], $gtlang);
$curlscore=$arr[0];
$curcscore=$arr[1];
$curgtlang=$arr[2];
- $found=TRUE;
+ $found=TRUE;
}
}
}