Bug #60675 [Com]: htmlentities(ENT_COMPAT, windows-1251) for ISO-8859-1 encoded scripts
Edit report at https://bugs.php.net/bug.php?id=60675&edit=1 ID: 60675 Comment by: dani...@php.net Reported by:dani...@php.net Summary:htmlentities(ENT_COMPAT, windows-1251) for ISO-8859-1 encoded scripts Status: Open Type: Bug Package:*General Issues Operating System: ubuntu 10.0.4 / lucid PHP Version:5.4SVN-2012-01-06 (SVN) Block user comment: N Private report: N New Comment: The test script is in PHP_5_4 and trunk as ext/standard/tests/strings/bug60675.phpt Previous Comments: [2012-01-06 22:09:36] dani...@php.net Automatic comment from SVN on behalf of danielc Revision: http://svn.php.net/viewvc/?view=revision&revision=321841 Log: Test for bug 60675. [2012-01-06 22:08:47] dani...@php.net Automatic comment from SVN on behalf of danielc Revision: http://svn.php.net/viewvc/?view=revision&revision=321840 Log: Test for bug 60675. [2012-01-06 21:58:01] dani...@php.net Description: The behavior htmlentities() (or PHP's parser/whatever) has changed between 5.3 and 5.4. I will put a phpt file in svn once the bug number is known. Test script: --- $in = 'Ãåñòèðóåì'; echo htmlentities($in, ENT_COMPAT, 'windows-1251'); Expected result: Тестируем Actual result: -- illegible -- Edit this bug report at https://bugs.php.net/bug.php?id=60675&edit=1
[PHP-BUG] Bug #60675 [NEW]: htmlentities(ENT_COMPAT, windows-1251) for ISO-8859-1 encoded scripts
From: danielc Operating system: ubuntu 10.0.4 / lucid PHP version: 5.4SVN-2012-01-06 (SVN) Package: *General Issues Bug Type: Bug Bug description:htmlentities(ENT_COMPAT, windows-1251) for ISO-8859-1 encoded scripts Description: The behavior htmlentities() (or PHP's parser/whatever) has changed between 5.3 and 5.4. I will put a phpt file in svn once the bug number is known. Test script: --- $in = 'Ãåñòèðóåì'; echo htmlentities($in, ENT_COMPAT, 'windows-1251'); Expected result: Тестируем Actual result: -- illegible -- Edit bug report at https://bugs.php.net/bug.php?id=60675&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60675&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60675&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60675&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60675&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60675&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60675&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60675&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60675&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60675&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60675&r=support Expected behavior: https://bugs.php.net/fix.php?id=60675&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60675&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60675&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60675&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60675&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60675&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60675&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60675&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60675&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60675&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60675&r=mysqlcfg
Bug #51051 [Com]: DateTime modify wrong result with DST change
Edit report at https://bugs.php.net/bug.php?id=51051&edit=1 ID: 51051 Comment by: dani...@php.net Reported by:mehdi dot rande at aliasource dot fr Summary:DateTime modify wrong result with DST change Status: Assigned Type: Bug Package:Date/time related Operating System: Linux PHP Version:5.3.1 Assigned To:derick Block user comment: N Private report: N New Comment: This will be addressed by https://wiki.php.net/rfc/datetime_and_daylight_saving_time Previous Comments: [2011-04-18 17:30:09] halde at freenet dot de reproduced issue of previous poster on a linux machine (timestamps are not equal): $ php -a Interactive shell php > $dt = new DateTime('now', new DateTimeZone('Europe/Berlin')); php > $dt->setTimestamp(1288483200); php > echo $dt->getTimestamp(); 1288486800 php > echo phpversion(); 5.3.3-1ubuntu9.3 php > exit $ uname -a Linux wum128229 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:39:03 UTC 2011 x86_64 GNU/Linux [2011-02-24 17:07:56] j dot ek at gmx dot net Think I found a related issue, reproduce it with: setTimestamp(1288483200); // but returns timestamp of 2010-10-31T02:00:00+0100 echo $dt->getTimestamp(); // outputs 1288486800 ?> WinXP 32, PHP 5.3.2 (cli) (built: Mar 3 2010 20:36:54) [2010-12-25 02:46:45] danielc at analysisandsolutions dot com DateTime::diff() is similarly afflicted with daylight/standard change over issues. Naturally, diff/add/sub all need to be in sync so intervals returned by diff can be passed to add/sub and produce the original datetime. ---- [2010-12-25 02:27:22] dani...@php.net I just attached a test script that covers issues in the spring and fall. ---- [2010-12-25 02:26:16] dani...@php.net The following patch has been added/updated: Patch Name: bug51051test.php.txt Revision: 1293240376 URL: http://bugs.php.net/patch-display.php?bug=51051&patch=bug51051test.php.txt&revision=1293240376 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=51051 -- Edit this bug report at https://bugs.php.net/bug.php?id=51051&edit=1
Bug #55253 [Com]: DateTime::add() and sub() result -1 hour on objects with time zone type 2
Edit report at https://bugs.php.net/bug.php?id=55253&edit=1 ID: 55253 Comment by: dani...@php.net Reported by:danielc at analysisandsolutions dot com Summary:DateTime::add() and sub() result -1 hour on objects with time zone type 2 Status: Open Type: Bug Package:Date/time related Operating System: Ubuntu 10.04 PHP Version:5.4SVN-2011-07-20 (SVN) Block user comment: N Private report: N New Comment: This is probably related to https://bugs.php.net/bug.php?id=60236 Previous Comments: [2011-07-20 14:24:08] dani...@php.net Automatic comment from SVN on behalf of danielc Revision: http://svn.php.net/viewvc/?view=revision&revision=313484 Log: Rename and enhance test for bug 55253 now that bugs web is up. [2011-07-20 14:18:36] danielc at analysisandsolutions dot com Description: Calling add() or sub() on DateTime objects using a type 2 time zone results in the answer being behind by one hour. Test script has been added to SVN. Test script: --- date_default_timezone_set('America/New_York'); $interval = new DateInterval('PT2H1M'); $date3 = new DateTime('2010-10-04 02:18:48'); $date2 = new DateTime('2010-10-04 02:18:48 EDT'); echo 'Zone Type 3: ' . $date3->format('Y-m-d H:i:s T') . "\n"; echo 'Zone Type 2: ' . $date2->format('Y-m-d H:i:s T') . "\n"; echo $interval->format('Add %h hours %i minutes') . "\n"; $date3->add($interval); $date2->add($interval); echo 'Zone Type 3: ' . $date3->format('Y-m-d H:i:s T') . "\n"; echo 'Zone Type 2: ' . $date2->format('Y-m-d H:i:s T') . "\n"; // Try subtracting from expected result. $date3 = new DateTime('2010-10-04 04:19:48'); $date2 = new DateTime('2010-10-04 04:19:48 EDT'); echo $interval->format('Subtract %h hours %i minutes from expected') . "\n"; $date3->sub($interval); $date2->sub($interval); echo 'Zone Type 3: ' . $date3->format('Y-m-d H:i:s T') . "\n"; echo 'Zone Type 2: ' . $date2->format('Y-m-d H:i:s T') . "\n"; Expected result: Zone Type 3: 2010-10-04 02:18:48 EDT Zone Type 2: 2010-10-04 02:18:48 EDT Add 2 hours 1 minutes Zone Type 3: 2010-10-04 04:19:48 EDT Zone Type 2: 2010-10-04 04:19:48 EDT Subtract 2 hours 1 minutes from expected Zone Type 3: 2010-10-04 02:18:48 EDT Zone Type 2: 2010-10-04 02:18:48 EDT Actual result: -- Zone Type 3: 2010-10-04 02:18:48 EDT Zone Type 2: 2010-10-04 02:18:48 EDT Add 2 hours 1 minutes Zone Type 3: 2010-10-04 04:19:48 EDT Zone Type 2: 2010-10-04 03:19:48 EDT Subtract 2 hours 1 minutes from expected Zone Type 3: 2010-10-04 02:18:48 EDT Zone Type 2: 2010-10-04 01:18:48 EDT -- Edit this bug report at https://bugs.php.net/bug.php?id=55253&edit=1
Bug #60236 [Com]: TLA timezone dates are not converted properly from timestamp
Edit report at https://bugs.php.net/bug.php?id=60236&edit=1 ID: 60236 Comment by: dani...@php.net Reported by:s...@php.net Summary:TLA timezone dates are not converted properly from timestamp Status: Assigned Type: Bug Package:Date/time related Operating System: * PHP Version:5.4.0beta2 Assigned To:derick Block user comment: N Private report: N New Comment: This is probably related to https://bugs.php.net/bug.php?id=55253 Previous Comments: [2011-11-07 18:10:33] s...@php.net Description: If you convert a date with TLA timezone (like EDT) to timestamp, and then convert it back from timestamp, resulting date is off by an hour. See example below. Test script: --- format('U'); var_dump($ts); $t->setTimestamp($ts); var_dump($t); Expected result: string(10) "1278455908" object(DateTime)#1 (3) { ["date"]=> string(19) "2010-07-06 18:38:28" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "EDT" } Actual result: -- string(10) "1278455908" object(DateTime)#1 (3) { ["date"]=> string(19) "2010-07-06 17:38:28" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "EDT" } -- Edit this bug report at https://bugs.php.net/bug.php?id=60236&edit=1
Bug #51051 [Com]: DateTime modify wrong result with DST change
Edit report at http://bugs.php.net/bug.php?id=51051&edit=1 ID: 51051 Comment by: dani...@php.net Reported by:mehdi dot rande at aliasource dot fr Summary:DateTime modify wrong result with DST change Status: Assigned Type: Bug Package:Date/time related Operating System: Linux PHP Version:5.3.1 Assigned To:derick Block user comment: N Private report: N New Comment: I just attached a test script that covers issues in the spring and fall. Previous Comments: [2010-12-25 02:26:16] dani...@php.net The following patch has been added/updated: Patch Name: bug51051test.php.txt Revision: 1293240376 URL: http://bugs.php.net/patch-display.php?bug=51051&patch=bug51051test.php.txt&revision=1293240376 [2010-08-24 14:34:22] glennpratt+php at gmail dot com Correction for the Expected result above. Expected Result --- 2011-03-13T03:00:00-05:00 America/Chicago 2011-03-13T01:58:00-06:00 America/Chicago [2010-08-24 00:04:28] glennpratt at gmail dot com Same issue here on PHP 5.3.2 format('c e')); $date->modify('-2 minutes'); print($date->format('c e')); ?> Actual Result - 2011-03-13T03:00:00-05:00 America/Chicago 2011-03-13T03:58:00-05:00 America/Chicago Expected Result --- 2011-03-13T03:00:00-05:00 America/Chicago 2011-03-13T01:58:00-05:00 America/Chicago Comparison: Ruby time library - irb(main):015:0> date = Time.parse('2011-03-13T03:00:00 in CST') => Sun Mar 13 03:00:00 -0500 2011 irb(main):016:0> date - 120 => Sun Mar 13 01:58:00 -0600 2011 [2010-02-15 10:56:45] mehdi dot rande at aliasource dot fr Sorry the expected result is in fact the actual result, and the actual result is the expected result. [2010-02-15 10:55:19] mehdi dot rande at aliasource dot fr Description: When adding seconds (or minutes or hours) to a datetime via the modify method, if the date before modification is before the DST change and the date after modification is after the DST change, the date after modification will be wrong. php 5.2 seems to be affected too. Reproduce code: --- format('c')); // DST change : 2012-10-28 01:00:00 $dateAfter = new DateTime("2012-10-28 12:00:00", new DateTimezone("Europe/Paris")); var_dump($dateAfter->format('c')); $diff = $dateAfter->format('U') - $dateBefore->format('U'); var_dump($diff); // === 25 hours, $dateBefore->modify('+'.$diff.' seconds'); var_dump($dateBefore->format('c')); ?> Expected result: string(25) "2012-10-27T12:00:00+02:00" string(25) "2012-10-28T12:00:00+01:00" int(9) string(25) "2012-10-28T13:00:00+01:00" Actual result: -- string(25) "2012-10-27T12:00:00+02:00" string(25) "2012-10-28T12:00:00+01:00" int(9) string(25) "2012-10-28T12:00:00+01:00" -- Edit this bug report at http://bugs.php.net/bug.php?id=51051&edit=1
Bug #51051 [PATCH]: DateTime modify wrong result with DST change
Edit report at http://bugs.php.net/bug.php?id=51051&edit=1 ID: 51051 Patch added by: dani...@php.net Reported by:mehdi dot rande at aliasource dot fr Summary:DateTime modify wrong result with DST change Status: Assigned Type: Bug Package:Date/time related Operating System: Linux PHP Version:5.3.1 Assigned To:derick Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: bug51051test.php.txt Revision: 1293240376 URL: http://bugs.php.net/patch-display.php?bug=51051&patch=bug51051test.php.txt&revision=1293240376 Previous Comments: [2010-08-24 14:34:22] glennpratt+php at gmail dot com Correction for the Expected result above. Expected Result --- 2011-03-13T03:00:00-05:00 America/Chicago 2011-03-13T01:58:00-06:00 America/Chicago [2010-08-24 00:04:28] glennpratt at gmail dot com Same issue here on PHP 5.3.2 format('c e')); $date->modify('-2 minutes'); print($date->format('c e')); ?> Actual Result - 2011-03-13T03:00:00-05:00 America/Chicago 2011-03-13T03:58:00-05:00 America/Chicago Expected Result --- 2011-03-13T03:00:00-05:00 America/Chicago 2011-03-13T01:58:00-05:00 America/Chicago Comparison: Ruby time library - irb(main):015:0> date = Time.parse('2011-03-13T03:00:00 in CST') => Sun Mar 13 03:00:00 -0500 2011 irb(main):016:0> date - 120 => Sun Mar 13 01:58:00 -0600 2011 [2010-02-15 10:56:45] mehdi dot rande at aliasource dot fr Sorry the expected result is in fact the actual result, and the actual result is the expected result. [2010-02-15 10:55:19] mehdi dot rande at aliasource dot fr Description: When adding seconds (or minutes or hours) to a datetime via the modify method, if the date before modification is before the DST change and the date after modification is after the DST change, the date after modification will be wrong. php 5.2 seems to be affected too. Reproduce code: --- format('c')); // DST change : 2012-10-28 01:00:00 $dateAfter = new DateTime("2012-10-28 12:00:00", new DateTimezone("Europe/Paris")); var_dump($dateAfter->format('c')); $diff = $dateAfter->format('U') - $dateBefore->format('U'); var_dump($diff); // === 25 hours, $dateBefore->modify('+'.$diff.' seconds'); var_dump($dateBefore->format('c')); ?> Expected result: string(25) "2012-10-27T12:00:00+02:00" string(25) "2012-10-28T12:00:00+01:00" int(9) string(25) "2012-10-28T13:00:00+01:00" Actual result: -- string(25) "2012-10-27T12:00:00+02:00" string(25) "2012-10-28T12:00:00+01:00" int(9) string(25) "2012-10-28T12:00:00+01:00" -- Edit this bug report at http://bugs.php.net/bug.php?id=51051&edit=1