php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49623 PHP shows deprecation warning BEFORE compressed body
Submitted: 2009-09-22 13:32 UTC Modified: 2009-09-22 22:05 UTC
From: 3 at 14 dot by Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.3.0 OS: 2.6.28-15-generic #49-Ubuntu SMP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: 3 at 14 dot by
New email:
PHP Version: OS:

 

 [2009-09-22 13:32 UTC] 3 at 14 dot by
Description:
------------
I have set Error_Reporting(0) both in the script & in the php.ini.
I have an PHPBB forum (3.0.6) with zlib compression turned on.

Most of the warnings are gone, but in some cases (when some data is sent via POST), I am still getting a Notice "<b>date(): It is not safe to rely on the system's timezone settings.", and it is printed BEFORE compressed page body, so that browser reports broken encoding. 

After disabling zlib compression browser started to show notice and page content. After setting date.timezone in php.ini Notice is gone.

Reproduce code:
---------------
Install PHPBB 3.0.6: turn zlib compression = on, make sure to unset date.timezone in php.ini. Then try to reply to a private message.

Expected result:
----------------
No notices on the screen, no "broken encoding"

Actual result:
--------------
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 22 Sep 2009 13:09:15 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Expires: 0
Last-Modified: Tue, 22 Sep 2009 13:09:15 GMT
Cache-Control: private, no-cache="set-cookie"
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 3181

<b>[phpBB Debug] PHP Notice</b>: in file <b>/includes/functions_messenger.php</b> on line <b>390</b>: <b>date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSD/4.0/DST' instead</b><br />
.............n.8...
V.&I[[..\j[..4.)..L..Y.E@I....U....
.Cv_...%{.)..%i.S#.E...d....>....9.t,..w./.............3..o../H..O.....u._9...N..;....^[fSw..{.T:.V<...i.:tF..ar..Dy[.t.<yb.....s..."h2.............h8j6.1.. ........2.,.-.H.C...hv.]d2 AD3...n|.:v.;........[here goes the rest of the compressed page]


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-22 16:11 UTC] 3 at 14 dot by
typo
 [2009-09-22 16:18 UTC] sjoerd@php.net
Thank you for your bug report.

That PHP shows a warning even though error reporting is disabled sounds like bug #49362, "Deprecated php.ini options warnings output even with display_errors=off".
 [2009-09-22 20:34 UTC] jani@php.net
That's quite expected and unfixable.
 [2009-09-22 22:05 UTC] 3 at 14 dot by
Is it possible at least to show a warning in the compressed part, not before so that browsers would behave much nicer? 

It is really confusing, and if one have no idea how to sniff HTTP traffic, it might eat huge amount of time to figure out the cause.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue May 17 08:05:45 2022 UTC