Re: HTTP_ACCEPT_LANGUAGE
Dave Hall <dave.hall-EkueOdtsCqu6c6uEtOJ/[email protected]> Sat, 14 Feb 2004 19:24:34 +0800
| Newsgroups | gmane.comp.bug-tracking.anthill.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --Boundary_(ID_b5C+2q1gPU5SE8ie7qH1CA) Content-type: text/plain; charset=us-ascii Content-disposition: inline Content-transfer-encoding: 7BIT Hi Moritz, That is a notice not a warning. PHP has several error reporting levels, E_NOTICE reporting should not be used in production environments. >From the php manual ( see http://www.php.net/manual/en/ref.errorfunc.php#ini.error-reporting ): " In PHP 4 and PHP 5 the default value is E_ALL & ~E_NOTICE. This setting does not show E_NOTICE level errors. You may want to show them during development." A way of avoiding this is to change the offending line to: if (@$_SERVER['HTTP_ACCEPT_LANGUAGE']) The "@" supressed the "error", but placing @s everywhere can hinder the finding of real bugs when hunting for them. This is part of the reason why the default error reporting level in PHP is E_ALL & ~E_NOTICE Cheers Dave Hall (aka skwashd) PS /me returns to lurking Content-Disposition: inline Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7cm2iqirTL37Ot+N" --7cm2iqirTL37Ot+N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Heya, just installed 0.3.0 ;) Works fine so far. Anyway, a problem that occured last time as well resurfaced when I copied over the new files. In site.inc.php you check for the language: if ($_SERVER['HTTP_ACCEPT_LANGUAGE']) etc. Unfortunately this will print a warning in my case in the browser: Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /home/www/bunkus.org/html/anthill/include/site.inc.php on line 76 Is there a way in PHP to test if a hash actually contains a specific key? If yes this warning can be avoided easily by testing for its existance and anding that with the test if it actually has a useful value. Note: I'm still using Apache 2 with PHP4 as a cgi-bin executable. Mosu --=20 If Darl McBride was in charge, he'd probably make marriage unconstitutional too, since clearly it de-emphasizes the commercial nature of normal human interaction, and probably is a major impediment to the commercial growth of prostitution. - Linus Torvalds --7cm2iqirTL37Ot+N-- --Boundary_(ID_b5C+2q1gPU5SE8ie7qH1CA) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline Content-transfer-encoding: 7BIT _______________________________________________ Anthill-workers mailing list Anthill-workers-+mQDA36h6dWw5LPnMra/[email protected] http://vmlinuz.ca/mailman/listinfo/anthill-workers --Boundary_(ID_b5C+2q1gPU5SE8ie7qH1CA) Content-type: text/x-vcard; charset=us-ascii; name=dave.hall.vcf Content-description: Card for <dave.hall-EkueOdtsCqu6c6uEtOJ/[email protected]> Content-disposition: attachment; filename=dave.hall.vcf Content-transfer-encoding: 7BIT begin:vcard n:Hall;Dave fn:Dave Hall tel;fax:+61 3 8610 0029 tel;work:+61 3 96 871 871 org:Dave Hall Consulting; adr:;;;;;;AUSTRALIA version:2.1 email;internet:dave.hall-EkueOdtsCqu6c6uEtOJ/[email protected] end:vcard --Boundary_(ID_b5C+2q1gPU5SE8ie7qH1CA) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Anthill-workers mailing list Anthill-workers-+mQDA36h6dWw5LPnMra/[email protected] http://vmlinuz.ca/mailman/listinfo/anthill-workers --Boundary_(ID_b5C+2q1gPU5SE8ie7qH1CA)--