cvs: pear /I18N Negotiator.php

From: Date: Wed, 27 Feb 2002 12:08:42 +0000
Subject: cvs: pear /I18N Negotiator.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-2621@lists.php.net to get a copy of this message
murahachibu Wed Feb 27 07:08:42 2002 EDT Modified files: /pear/I18N Negotiator.php Log: fixed to work without register_globals being set by using Superglobals Index: pear/I18N/Negotiator.php diff -u pear/I18N/Negotiator.php:1.1 pear/I18N/Negotiator.php:1.2 --- pear/I18N/Negotiator.php:1.1 Wed Feb 13 15:01:58 2002 +++ pear/I18N/Negotiator.php Wed Feb 27 07:08:34 2002 @@ -16,7 +16,7 @@ // | Authors: Naoki Shima <murahachibu@php.net> | // | | // +----------------------------------------------------------------------+// -// $Id: Negotiator.php,v 1.1 2002/02/13 20:01:58 murahachibu Exp $ +// $Id: Negotiator.php,v 1.2 2002/02/27 12:08:34 murahachibu Exp $ /** * @@ -83,7 +83,12 @@ */ function I18N_Negotiator($defaultLanguage = 'en', $defaultCharset = 'ISO-8859-1', $defaultCountry = '') { - global $HTTP_ACCEPT_LANGUAGE,$HTTP_ACCEPT_CHARSET; + if($_SERVER) { + $HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE']; + $HTTP_ACCEPT_CHARSET = $_SERVER['HTTP_ACCEPT_CHARSET']; + } else { + global $HTTP_ACCEPT_LANGUAGE,$HTTP_ACCEPT_CHARSET; + } $this->_defaultCountry = $defaultCountry; $this->_defaultLanguage = $defaultLanguage; $this->_defaultCharset = $defaultCharest;

« previous php.pear.cvs (#2621) next »