derick          Wed Aug 31 10:29:24 2005 EDT

  Added files:                 (Branch: PHP_5_1)
    /php-src/ext/date/tests     bug33957.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/date/lib       dow.c 
  Log:
  - Fixed bug #33957 (gmdate('W')/date('W') sometimes returns wrong week 
number).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.33&r2=1.2027.2.34&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.33 php-src/NEWS:1.2027.2.34
--- php-src/NEWS:1.2027.2.33    Tue Aug 30 18:03:29 2005
+++ php-src/NEWS        Wed Aug 31 10:29:18 2005
@@ -46,6 +46,8 @@
   (Jani)
 - Fixed bug #33958 (duplicate cookies and magic_quotes=off may cause a crash).
   (Ilia)
+- Fixed bug #33957 (gmdate('W')/date('W') sometimes returns wrong week number).
+  (Derick)
 - Fixed bug #33940 (array_map() fails to pass by reference when called
   recursively). (Dmitry)
 - Fixed bug #33917 (number_format() output with > 1 char separators). (Jani)
http://cvs.php.net/diff.php/php-src/ext/date/lib/dow.c?r1=1.8&r2=1.8.2.1&ty=u
Index: php-src/ext/date/lib/dow.c
diff -u php-src/ext/date/lib/dow.c:1.8 php-src/ext/date/lib/dow.c:1.8.2.1
--- php-src/ext/date/lib/dow.c:1.8      Wed Aug  3 10:06:46 2005
+++ php-src/ext/date/lib/dow.c  Wed Aug 31 10:29:23 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: dow.c,v 1.8 2005/08/03 14:06:46 sniper Exp $ */
+/* $Id: dow.c,v 1.8.2.1 2005/08/31 14:29:23 derick Exp $ */
 
 #include "timelib.h"
 
@@ -91,7 +91,7 @@
                int i;
 
                i = y_leap ? 366 : 365;
-               if ((i - doy) < (4 - weekday)) {
+               if ((i - (doy - y_leap)) < (4 - weekday)) {
                        *iy = y + 1;
                        *iw = 1;
                        return;

http://cvs.php.net/co.php/php-src/ext/date/tests/bug33957.phpt?r=1.1&p=1
Index: php-src/ext/date/tests/bug33957.phpt
+++ php-src/ext/date/tests/bug33957.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to