[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c

2009-06-30 Thread Derick Rethans
derick  Tue Jun 30 16:18:34 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date   php_date.c 
/php-srcNEWS 
  Log:
  - MFH: Fixed bug #47351 (Memory leak in DateTime).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.73r2=1.43.2.45.2.74diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.73 
php-src/ext/date/php_date.c:1.43.2.45.2.74
--- php-src/ext/date/php_date.c:1.43.2.45.2.73  Mon Jun 22 13:42:28 2009
+++ php-src/ext/date/php_date.c Tue Jun 30 16:18:33 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.73 2009/06/22 13:42:28 iliaa Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.74 2009/06/30 16:18:33 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -1752,7 +1752,7 @@
}
timelib_unixtime2local(now, (timelib_sll) time(NULL));
 
-   timelib_fill_holes(dateobj-time, now, 0);
+   timelib_fill_holes(dateobj-time, now, TIMELIB_NO_CLONE);
timelib_update_ts(dateobj-time, tzi);
 
dateobj-time-have_weekday_relative = dateobj-time-have_relative = 0;
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1574r2=1.2027.2.547.2.1575diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1574 php-src/NEWS:1.2027.2.547.2.1575
--- php-src/NEWS:1.2027.2.547.2.1574Sun Jun 28 18:44:28 2009
+++ php-src/NEWSTue Jun 30 16:18:34 2009
@@ -22,6 +22,7 @@
 - Fixed bug #48450 (Compile failure under IRIX 6.5.30 building gd.c). (Kalle)
 - Fixed bug #48276 (date(Y) on big endian machines produces the
   wrong result). (Scott)
+- Fixed bug #47351 (Memory leak in DateTime). (Derick, Tobias John)
 
 17 Jun 2009, PHP 5.2.10
 - Updated timezone database to version 2009.9 (2009i) (Derick)



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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c

2009-06-22 Thread Ilia Alshanetsky
iliaa   Mon Jun 22 13:42:30 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date   php_date.c 
/php-srcNEWS 
  Log:
  
  Fixed bug #48636 (Error compiling of ext/date on netware).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.72r2=1.43.2.45.2.73diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.72 
php-src/ext/date/php_date.c:1.43.2.45.2.73
--- php-src/ext/date/php_date.c:1.43.2.45.2.72  Sun Jun 21 22:19:19 2009
+++ php-src/ext/date/php_date.c Mon Jun 22 13:42:28 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.72 2009/06/21 22:19:19 scottmac Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.73 2009/06/22 13:42:28 iliaa Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -38,6 +38,10 @@
 static __inline __int64_t llabs( __int64_t i ) { return i = 0 ? i : -i; }
 #endif
 
+#if defined(NETWARE)  defined(__MWERKS__)
+static __inline long long llabs( long long i ) { return i = 0 ? i : -i; }
+#endif
+
 /* {{{ arginfo */
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1563r2=1.2027.2.547.2.1564diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1563 php-src/NEWS:1.2027.2.547.2.1564
--- php-src/NEWS:1.2027.2.547.2.1563Mon Jun 22 00:03:24 2009
+++ php-src/NEWSMon Jun 22 13:42:29 2009
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? ??? 2009, PHP 5.2.11
+- Fixed bug #48636 (Error compiling of ext/date on netware). (guenter at
+  php.net, Ilia)
 - Fixed bug #48629 (get_defined_constants() ignores categorize parameter).
   (Felipe)
 - Fixed bug #48276 (date(Y) on big endian machines produces the



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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/lib timelib_structs.h tm2unixtime.c /ext/date/tests bug48058.phpt date_create-relative.phpt strtotime-relative.phpt

2009-05-03 Thread Derick Rethans
derick  Sun May  3 18:22:59 2009 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/date/tests bug48058.phpt date_create-relative.phpt 
strtotime-relative.phpt 

  Modified files:  
/php-src/ext/date   php_date.c 
/php-src/ext/date/lib   timelib_structs.h tm2unixtime.c 
/php-srcNEWS 
  Log:
  - MFH: Fixed bug #48058 (Year formatter goes wrong with out-of-int range).
  - MFH: Fixed bug #45822 (Near infinite-loops while parsing huge relative 
offsets).
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.64r2=1.43.2.45.2.65diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.64 
php-src/ext/date/php_date.c:1.43.2.45.2.65
--- php-src/ext/date/php_date.c:1.43.2.45.2.64  Wed Dec 31 11:17:36 2008
+++ php-src/ext/date/php_date.c Sun May  3 18:22:59 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.64 2008/12/31 11:17:36 sebastian Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.65 2009/05/03 18:22:59 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -787,7 +787,7 @@
/* year */
case 'L': length = slprintf(buffer, 32, %d, 
timelib_is_leap((int) t-y)); break;
case 'y': length = slprintf(buffer, 32, %02d, (int) 
t-y % 100); break;
-   case 'Y': length = slprintf(buffer, 32, %s%04d, t-y 
 0 ? - : , abs((int) t-y)); break;
+   case 'Y': length = slprintf(buffer, 32, %s%04ld, t-y 
 0 ? - : , llabs(t-y)); break;
 
/* time */
case 'a': length = slprintf(buffer, 32, %s, t-h = 
12 ? pm : am); break;
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/timelib_structs.h?r1=1.13.2.6.2.6r2=1.13.2.6.2.7diff_format=u
Index: php-src/ext/date/lib/timelib_structs.h
diff -u php-src/ext/date/lib/timelib_structs.h:1.13.2.6.2.6 
php-src/ext/date/lib/timelib_structs.h:1.13.2.6.2.7
--- php-src/ext/date/lib/timelib_structs.h:1.13.2.6.2.6 Wed Dec 31 11:17:36 2008
+++ php-src/ext/date/lib/timelib_structs.h  Sun May  3 18:22:59 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: timelib_structs.h,v 1.13.2.6.2.6 2008/12/31 11:17:36 sebastian Exp $ */
+/* $Id: timelib_structs.h,v 1.13.2.6.2.7 2009/05/03 18:22:59 derick Exp $ */
 
 #ifndef __TIMELIB_STRUCTS_H__
 #define __TIMELIB_STRUCTS_H__
@@ -200,6 +200,9 @@
 #define SECS_PER_DAY   86400
 #define DAYS_PER_YEAR365
 #define DAYS_PER_LYEAR   366
+/* 400*365 days + 97 leap days */
+#define DAYS_PER_LYEAR_PERIOD 146097
+#define YEARS_PER_LYEAR_PERIOD 400
 
 #define timelib_is_leap(y) ((y) % 4 == 0  ((y) % 100 != 0 || (y) % 400 == 0))
 
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/tm2unixtime.c?r1=1.13.2.3.2.7r2=1.13.2.3.2.8diff_format=u
Index: php-src/ext/date/lib/tm2unixtime.c
diff -u php-src/ext/date/lib/tm2unixtime.c:1.13.2.3.2.7 
php-src/ext/date/lib/tm2unixtime.c:1.13.2.3.2.8
--- php-src/ext/date/lib/tm2unixtime.c:1.13.2.3.2.7 Wed Dec 31 11:17:36 2008
+++ php-src/ext/date/lib/tm2unixtime.c  Sun May  3 18:22:59 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: tm2unixtime.c,v 1.13.2.3.2.7 2008/12/31 11:17:36 sebastian Exp $ */
+/* $Id: tm2unixtime.c,v 1.13.2.3.2.8 2009/05/03 18:22:59 derick Exp $ */
 
 #include timelib.h
 
@@ -31,20 +31,12 @@
 static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, 
timelib_sll *a, timelib_sll *b)
 {
if (*a  start) {
-   *a += adj;
-   (*b)--;
-   return 1;
+   *b -= (start - *a - 1) / adj + 1;
+   *a += adj * ((start - *a - 1) / adj + 1);
}
if (*a = end) {
-   if (start == 0) {
-   (*b) += (*a / end);
-   (*a) -= (end * (*a / end));
-   return 0;
-   }
-
-   *a -= adj;
-   (*b)++;
-   return 1;
+   *b += *a / adj;
+   *a -= adj * (*a / adj);
}
return 0;
 }
@@ -55,6 +47,12 @@
timelib_sll days_this_month;
timelib_sll last_month, last_year;
timelib_sll days_last_month;
+   
+   /* can jump an entire leap year period quickly */
+   if (*d = DAYS_PER_LYEAR_PERIOD || *d = -DAYS_PER_LYEAR_PERIOD) {
+   *y += YEARS_PER_LYEAR_PERIOD * (*d / DAYS_PER_LYEAR_PERIOD);
+   *d -= DAYS_PER_LYEAR_PERIOD * (*d / DAYS_PER_LYEAR_PERIOD);
+   }
 
do_range_limit(1, 13, 12, m, y);
 
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1485r2=1.2027.2.547.2.1486diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1485 php-src/NEWS:1.2027.2.547.2.1486
--- 

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/lib parse_date.c parse_date.re timelib.h

2008-12-18 Thread Derick Rethans
derick  Thu Dec 18 14:57:19 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/date   php_date.c 
/php-src/ext/date/lib   parse_date.c parse_date.re timelib.h 
  Log:
  - MFH: Fixed bug #46889: Memory leak in strtotime().
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1363r2=1.2027.2.547.2.1364diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1363 php-src/NEWS:1.2027.2.547.2.1364
--- php-src/NEWS:1.2027.2.547.2.1363Thu Dec 18 14:29:38 2008
+++ php-src/NEWSThu Dec 18 14:56:45 2008
@@ -6,6 +6,7 @@
 - Fixed security issue in imagerotate(), background colour isn't validated
   correctly with a non truecolour image. (Fixes CVE-2008-5498) (Scott)
 
+- Fixed bug #46889: Memory leak in strtotime(). (Derick)
 - Fixed bug #46798 (Crash in mssql extension when retrieving a NULL value
   inside a binary or image column type). (Ilia)
 - Fixed bug #46782 (fastcgi.c parse error). (Matt)
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.62r2=1.43.2.45.2.63diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.62 
php-src/ext/date/php_date.c:1.43.2.45.2.63
--- php-src/ext/date/php_date.c:1.43.2.45.2.62  Tue Dec  2 18:01:57 2008
+++ php-src/ext/date/php_date.c Thu Dec 18 14:56:46 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.62 2008/12/02 18:01:57 derick Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.63 2008/12/18 14:56:46 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -1143,7 +1143,7 @@
t = timelib_strtotime(times, time_len, error, DATE_TIMEZONEDB);
error1 = error-error_count;
timelib_error_container_dtor(error);
-   timelib_fill_holes(t, now, 0);
+   timelib_fill_holes(t, now, TIMELIB_NO_CLONE);
timelib_update_ts(t, tzi);
ts = timelib_date_to_int(t, error2);
 
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.29.2.30.2.17r2=1.29.2.30.2.18diff_format=u
Index: php-src/ext/date/lib/parse_date.c
diff -u php-src/ext/date/lib/parse_date.c:1.29.2.30.2.17 
php-src/ext/date/lib/parse_date.c:1.29.2.30.2.18
--- php-src/ext/date/lib/parse_date.c:1.29.2.30.2.17Sun Oct 26 11:27:07 2008
+++ php-src/ext/date/lib/parse_date.c   Thu Dec 18 14:56:46 2008
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sun Oct 26 11:59:08 2008 */
+/* Generated by re2c 0.13.5 on Thu Dec 18 15:52:22 2008 */
 #line 1 ext/date/lib/parse_date.re
 /*
+--+
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: parse_date.c,v 1.29.2.30.2.17 2008/10/26 11:27:07 derick Exp $ */
+/* $Id: parse_date.c,v 1.29.2.30.2.18 2008/12/18 14:56:46 derick Exp $ */
 
 #include timelib.h
 
@@ -22483,7 +22483,7 @@
 
 void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
 {
-   if (!(options  TIMELIB_OVERRIDE_TIME)  parsed-have_date  
!parsed-have_time) {
+   if (!(options  TIMELIB_OVERRIDE_TIME)  parsed-have_date  
!parsed-have_time) {
parsed-h = 0;
parsed-i = 0;
parsed-s = 0;
@@ -22503,7 +22503,7 @@
parsed-tz_abbr = now-tz_abbr ? strdup(now-tz_abbr) : NULL;
}
if (!parsed-tz_info) {
-   parsed-tz_info = now-tz_info ? 
timelib_tzinfo_clone(now-tz_info) : NULL;
+   parsed-tz_info = now-tz_info ? (!(options  TIMELIB_NO_CLONE) 
? timelib_tzinfo_clone(now-tz_info) : now-tz_info) : NULL;
}
if (parsed-zone_type == 0  now-zone_type != 0) {
parsed-zone_type = now-zone_type;
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.26.2.27.2.14r2=1.26.2.27.2.15diff_format=u
Index: php-src/ext/date/lib/parse_date.re
diff -u php-src/ext/date/lib/parse_date.re:1.26.2.27.2.14 
php-src/ext/date/lib/parse_date.re:1.26.2.27.2.15
--- php-src/ext/date/lib/parse_date.re:1.26.2.27.2.14   Sun Oct 26 11:27:32 2008
+++ php-src/ext/date/lib/parse_date.re  Thu Dec 18 14:57:04 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: parse_date.re,v 1.26.2.27.2.14 2008/10/26 11:27:32 derick Exp $ */
+/* $Id: parse_date.re,v 1.26.2.27.2.15 2008/12/18 14:57:04 derick Exp $ */
 
 #include timelib.h
 
@@ -1619,7 +1619,7 @@
 
 void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
 {
-   if (!(options  TIMELIB_OVERRIDE_TIME)  parsed-have_date  
!parsed-have_time) {
+   if (!(options  TIMELIB_OVERRIDE_TIME)  parsed-have_date  
!parsed-have_time) {
parsed-h = 0;
parsed-i = 0;
parsed-s = 0;
@@ -1639,7 +1639,7 @@
parsed-tz_abbr = now-tz_abbr ? strdup(now-tz_abbr) : NULL;
}
if (!parsed-tz_info) {
- 

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/tests mktime-3-64bit.phpt

2008-12-02 Thread Derick Rethans
derick  Tue Dec  2 18:01:58 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/date   php_date.c 
/php-src/ext/date/tests mktime-3-64bit.phpt 
  Log:
  - MFH: Fixed bug #46732 (mktime.year description is wrong).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1343r2=1.2027.2.547.2.1344diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1343 php-src/NEWS:1.2027.2.547.2.1344
--- php-src/NEWS:1.2027.2.547.2.1343Mon Dec  1 20:57:11 2008
+++ php-src/NEWSTue Dec  2 18:01:57 2008
@@ -5,6 +5,7 @@
   reported by Maksymilian Arciemowicz. (Stas)
 
 - Fixed bug #46366 (bad cwd with / as pathinfo). (Dmitry)
+- Fixed bug #46732 (mktime.year description is wrong). (Derick)
 
 27 Nov 2008, PHP 5.2.7RC5
 - Upgraded PCRE to version 7.8 (Fixes CVE-2008-2371) (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.61r2=1.43.2.45.2.62diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.61 
php-src/ext/date/php_date.c:1.43.2.45.2.62
--- php-src/ext/date/php_date.c:1.43.2.45.2.61  Sun Oct 26 11:27:06 2008
+++ php-src/ext/date/php_date.c Tue Dec  2 18:01:57 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.61 2008/10/26 11:27:06 derick Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.62 2008/12/02 18:01:57 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -1188,7 +1188,7 @@
case 6:
if (yea = 0  yea  70) {
yea += 2000;
-   } else if (yea = 70  yea = 110) {
+   } else if (yea = 70  yea = 100) {
yea += 1900;
}
now-y = yea;
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/mktime-3-64bit.phpt?r1=1.1.4.2r2=1.1.4.3diff_format=u
Index: php-src/ext/date/tests/mktime-3-64bit.phpt
diff -u php-src/ext/date/tests/mktime-3-64bit.phpt:1.1.4.2 
php-src/ext/date/tests/mktime-3-64bit.phpt:1.1.4.3
--- php-src/ext/date/tests/mktime-3-64bit.phpt:1.1.4.2  Mon Feb 25 22:34:11 2008
+++ php-src/ext/date/tests/mktime-3-64bit.phpt  Tue Dec  2 18:01:58 2008
@@ -7,7 +7,7 @@
 --FILE--
 ?php
 $tzs = array(America/Toronto, Europe/Oslo);
-$years = array(0, 69, 70, 71, 99, 100, 105, 1900, 1901, 1902, 1999, 2000, 
2001);
+$years = array(0, 69, 70, 71, 99, 100, 101, 105, 110, 1900, 1901, 1902, 1999, 
2000, 2001);
 
 foreach ($tzs as $tz) {
echo $tz, \n;
@@ -32,7 +32,9 @@
 Y:   71 - January 1971-01-01T01:01:01-0500
 Y:   99 - January 1999-01-01T01:01:01-0500
 Y:  100 - January 2000-01-01T01:01:01-0500
-Y:  105 - January 2005-01-01T01:01:01-0500
+Y:  101 - January 0101-01-01T01:01:01-0500
+Y:  105 - January 0105-01-01T01:01:01-0500
+Y:  110 - January 0110-01-01T01:01:01-0500
 Y: 1900 - January 1900-01-01T01:01:01-0500
 Y: 1901 - January 1901-01-01T01:01:01-0500
 Y: 1902 - January 1902-01-01T01:01:01-0500
@@ -47,7 +49,9 @@
 Y:   71 - January 1971-01-01T01:01:01+0100
 Y:   99 - January 1999-01-01T01:01:01+0100
 Y:  100 - January 2000-01-01T01:01:01+0100
-Y:  105 - January 2005-01-01T01:01:01+0100
+Y:  101 - January 0101-01-01T01:01:01+0100
+Y:  105 - January 0105-01-01T01:01:01+0100
+Y:  110 - January 0110-01-01T01:01:01+0100
 Y: 1900 - January 1900-01-01T01:01:01+0100
 Y: 1901 - January 1901-01-01T01:01:01+0100
 Y: 1902 - January 1902-01-01T01:01:01+0100



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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/tests bug44742.phpt

2008-04-16 Thread Derick Rethans
derick  Wed Apr 16 17:21:46 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/date/tests bug44742.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/date   php_date.c 
  Log:
  - Fixed bug #44703 (htmlspecialchars() does not detect bad character set
argument).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1142r2=1.2027.2.547.2.1143diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1142 php-src/NEWS:1.2027.2.547.2.1143
--- php-src/NEWS:1.2027.2.547.2.1142Fri Apr 11 19:01:24 2008
+++ php-src/NEWSWed Apr 16 17:21:44 2008
@@ -1,8 +1,9 @@
 PHPNEWS
 |||
 ?? Apr 2008, PHP 5.2.6
-- Fixed bug #44703 (htmlspecialchars() does not detect bad character set 
argument)
-  (Andy Wharmby)
+- Fixed bug #44703 (htmlspecialchars() does not detect bad character set
+  argument). (Andy Wharmby)
+- Fixed bug #44742 (timezone_offset_get() causes segmentation faults). (Derick)
 
 10 Apr 2008, PHP 5.2.6RC5
 - Fixed incorrect heredoc handling when label is used within the block.
@@ -29,6 +30,9 @@
   (Ilia)
 - Fixed bug #44557 (Crash in imap_setacl when supplied integer as username)
   (Thomas Jarosch)
+- Fixed a bug in formatting timestamps when DST is active in the default
+  timezone (Derick)
+
 
 27 Mar 2008, PHP 5.2.6RC3
 - Properly address incomplete multibyte chars inside escapeshellcmd() (Ilia,
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.57r2=1.43.2.45.2.58diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.57 
php-src/ext/date/php_date.c:1.43.2.45.2.58
--- php-src/ext/date/php_date.c:1.43.2.45.2.57  Mon Mar 31 09:12:15 2008
+++ php-src/ext/date/php_date.c Wed Apr 16 17:21:46 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.57 2008/03/31 09:12:15 derick Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.58 2008/04/16 17:21:46 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -2271,9 +2271,19 @@
dateobj = (php_date_obj *) zend_object_store_get_object(dateobject 
TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj-time, DateTime);
 
-   offset = timelib_get_time_zone_info(dateobj-time-sse, tzobj-tzi.tz);
-   RETVAL_LONG(offset-offset);
-   timelib_time_offset_dtor(offset);
+   switch (tzobj-type) {
+   case TIMELIB_ZONETYPE_ID:
+   offset = timelib_get_time_zone_info(dateobj-time-sse, 
tzobj-tzi.tz);
+   RETVAL_LONG(offset-offset);
+   timelib_time_offset_dtor(offset);
+   break;
+   case TIMELIB_ZONETYPE_OFFSET:
+   RETURN_LONG(tzobj-tzi.utc_offset * -60);
+   break;
+   case TIMELIB_ZONETYPE_ABBR:
+   RETURN_LONG((tzobj-tzi.z.utc_offset - 
(tzobj-tzi.z.dst*60)) * -60);
+   break;
+   }
 }
 /* }}} */
 

http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug44742.phpt?view=markuprev=1.1
Index: php-src/ext/date/tests/bug44742.phpt
+++ php-src/ext/date/tests/bug44742.phpt



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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/lib parse_date.c tm2unixtime.c /ext/date/tests bug40743.phpt bug41599.phpt bug42910.phpt bug43003.phpt bug43527.phpt bug43808.p

2008-01-26 Thread Derick Rethans
derick  Sat Jan 26 16:26:56 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/date/tests bug40743.phpt bug41599.phpt bug42910.phpt 
bug43003.phpt bug43527.phpt bug43808.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/date   php_date.c 
/php-src/ext/date/lib   parse_date.c tm2unixtime.c 
  Log:
  - MFH Bugfixes:
- Fixed bug #43808 (date_create never fails (even when it should)).
- Fixed bug #43527 (DateTime created from a timestamp reports 
environment
  timezone).
- Fixed bug #43003 (Invalid timezone reported for DateTime objects
  constructed using a timestamp).
- Fixed bug #42190 (Constructing DateTime with TimeZone Indicator
  invalidates DateTimeZone).
- Fixed bug #41599 (setTime() fails after modify() is used).
  
  http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1059r2=1.2027.2.547.2.1060diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1059 php-src/NEWS:1.2027.2.547.2.1060
--- php-src/NEWS:1.2027.2.547.2.1059Wed Jan 23 01:22:57 2008
+++ php-src/NEWSSat Jan 26 16:26:33 2008
@@ -16,6 +16,7 @@
   in mysql_connect()). (Hannes)
 - Fixed bug #43863 (str_word_count() breaks on cyrillic ya in locale cp1251).
   (phprus at gmail dot com, Tony)
+- Fixed bug #43808 (date_create never fails (even when it should)). (Derick)
 - Fixed bug #43793 (zlib filter is unable to auto-detect gzip/zlib file 
headers).
   (Greg)
 - Fixed bug #43703 (Signature compatibility check broken). (Dmitry)
@@ -32,6 +33,8 @@
 - Fixed bug #43580 (removed bogus declaration of a non-existent php_is_url()  
   function). (Ilia)
 - Fixed bug #43533 (escapeshellarg('') returns null). (Ilia)
+- Fixed bug #43527 (DateTime created from a timestamp reports environment
+  timezone). (Derick)
 - Fixed bug #43522 (stream_get_line() eats additional characters). (Felipe,
   Ilia, Tony)
 - Fixed bug #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory).
@@ -57,6 +60,8 @@
   (Jani)
 - Fixed bug #43301 (mb_ereg*_replace() crashes when replacement string is
   invalid PHP expression and 'e' option is used). (Jani)
+- Fixed bug #43003 (Invalid timezone reported for DateTime objects constructed
+  using a timestamp). (Derick)
 - Fixed bug #43295 (crash because of uninitialized SG(sapi_headers).mimetype). 
   (Dmitry)
 - Fixed bug #43293 (Multiple segfaults in getopt()). (Hannes)
@@ -87,6 +92,9 @@
 - Fixed bug #42272 (var_export() incorrectly escapes char(0)). (Derick)
 - Fixed bug #42261 (Incorrect lengths for date and boolean data types).
   (Ilia)
+- Fixed bug #42190 (Constructing DateTime with TimeZone Indicator invalidates
+  DateTimeZone). (Derick)
+- Fixed bug #41599 (setTime() fails after modify() is used). (Derick)
 - Fixed bug #38468 (Unexpected creation of cycle). (Dmitry)
 
 08 Nov 2007, PHP 5.2.5
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.53r2=1.43.2.45.2.54diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.53 
php-src/ext/date/php_date.c:1.43.2.45.2.54
--- php-src/ext/date/php_date.c:1.43.2.45.2.53  Mon Dec 31 07:20:05 2007
+++ php-src/ext/date/php_date.c Sat Jan 26 16:26:33 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.53 2007/12/31 07:20:05 sebastian Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.54 2008/01/26 16:26:33 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -266,7 +266,18 @@
 
 struct _php_timezone_obj {
zend_object std;
-   timelib_tzinfo *tz;
+   int initialized;
+   int type;
+   union {
+   timelib_tzinfo *tz; // TIMELIB_ZONETYPE_ID;
+   timelib_sll utc_offset; // TIMELIB_ZONETYPE_OFFSET
+   struct  // TIMELIB_ZONETYPE_ABBR
+   {
+   timelib_sll  utc_offset;
+   char*abbr;
+   int  dst;
+   } z;
+   } tzi;
 };
 
 #define DATE_SET_CONTEXT \
@@ -808,7 +819,26 @@
  );
  break;
case 'T': length = slprintf(buffer, 32, %s, localtime 
? offset-abbr : GMT); break;
-   case 'e': length = slprintf(buffer, 32, %s, localtime 
? t-tz_info-name : UTC); break;
+   case 'e': if (!localtime) {
+ length = slprintf(buffer, 32, 
%s, UTC);
+ } else {
+ switch (t-zone_type) {
+ case 
TIMELIB_ZONETYPE_ID:
+ length = 
slprintf(buffer, 

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/tests date_sun_info_001.phpt date_sun_info_002.phpt

2007-04-13 Thread Derick Rethans
derick  Fri Apr 13 08:33:49 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/date/tests date_sun_info_002.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/date   php_date.c 
/php-src/ext/date/tests date_sun_info_001.phpt 
  Log:
  - Fixed bug #39965 (Latitude and longitude are backwards in date_sun_info()).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.642r2=1.2027.2.547.2.643diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.642 php-src/NEWS:1.2027.2.547.2.643
--- php-src/NEWS:1.2027.2.547.2.642 Fri Apr 13 08:10:54 2007
+++ php-src/NEWSFri Apr 13 08:33:48 2007
@@ -10,6 +10,8 @@
   units correctly). (Derick)
 - Fixed bug #40290 (strtotime() returns unexpected result with particular
   timezone offset). (Derick)
+- Fixed bug #39965 (Latitude and longitude are backwards in date_sun_info()).
+  (Derick)
 
 
 10 Apr 2007, PHP 5.2.2RC1
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.43r2=1.43.2.45.2.44diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.43 
php-src/ext/date/php_date.c:1.43.2.45.2.44
--- php-src/ext/date/php_date.c:1.43.2.45.2.43  Mon Mar  5 14:10:18 2007
+++ php-src/ext/date/php_date.c Fri Apr 13 08:33:48 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.43 2007/03/05 14:10:18 mike Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.44 2007/04/13 08:33:48 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -2387,7 +2387,7 @@
array_init(return_value);

/* Get sun up/down and transit */
-   rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -35.0/60, 
1, ddummy, ddummy, rise, set, transit);
+   rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -35.0/60, 
1, ddummy, ddummy, rise, set, transit);
switch (rs) {
case -1: /* always below */
add_assoc_bool(return_value, sunrise, 0);
@@ -2407,7 +2407,7 @@
add_assoc_long(return_value, transit, timelib_date_to_int(t2, 
dummy));
 
/* Get civil twilight */
-   rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -6.0, 0, 
ddummy, ddummy, rise, set, transit);
+   rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -6.0, 0, 
ddummy, ddummy, rise, set, transit);
switch (rs) {
case -1: /* always below */
add_assoc_bool(return_value, civil_twilight_begin, 0);
@@ -2425,7 +2425,7 @@
}
 
/* Get nautical twilight */
-   rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -12.0, 0, 
ddummy, ddummy, rise, set, transit);
+   rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -12.0, 0, 
ddummy, ddummy, rise, set, transit);
switch (rs) {
case -1: /* always below */
add_assoc_bool(return_value, nautical_twilight_begin, 
0);
@@ -2443,7 +2443,7 @@
}
 
/* Get astronomical twilight */
-   rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -18.0, 0, 
ddummy, ddummy, rise, set, transit);
+   rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -18.0, 0, 
ddummy, ddummy, rise, set, transit);
switch (rs) {
case -1: /* always below */
add_assoc_bool(return_value, 
astronomical_twilight_begin, 0);
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/date_sun_info_001.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/date/tests/date_sun_info_001.phpt
diff -u php-src/ext/date/tests/date_sun_info_001.phpt:1.1.2.2 
php-src/ext/date/tests/date_sun_info_001.phpt:1.1.2.3
--- php-src/ext/date/tests/date_sun_info_001.phpt:1.1.2.2   Fri Dec 22 
13:07:53 2006
+++ php-src/ext/date/tests/date_sun_info_001.phpt   Fri Apr 13 08:33:48 2007
@@ -11,22 +11,22 @@
 --EXPECTF--
 array(9) {
   [sunrise]=
-  int(1165899133)
+  int(1165897782)
   [sunset]=
-  int(1165934481)
+  int(1165934168)
   [transit]=
-  int(1165916807)
+  int(1165915975)
   [civil_twilight_begin]=
-  int(1165897449)
+  int(1165896176)
   [civil_twilight_end]=
-  int(1165936165)
+  int(1165935773)
   [nautical_twilight_begin]=
-  int(1165895547)
+  int(1165894353)
   [nautical_twilight_end]=
-  int(1165938067)
+  int(1165937597)
   [astronomical_twilight_begin]=
-  int(1165893693)
+  int(1165892570)
   [astronomical_twilight_end]=
-  int(1165939921)
+  int(1165939380)
 }
 Done

http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/date_sun_info_002.phpt?view=markuprev=1.1
Index: php-src/ext/date/tests/date_sun_info_002.phpt
+++ php-src/ext/date/tests/date_sun_info_002.phpt

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c

2007-04-13 Thread Derick Rethans
derick  Fri Apr 13 14:09:20 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/date   php_date.c 
  Log:
  - Fixed bug #39416 (Milliseconds in date()).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.643r2=1.2027.2.547.2.644diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.643 php-src/NEWS:1.2027.2.547.2.644
--- php-src/NEWS:1.2027.2.547.2.643 Fri Apr 13 08:33:48 2007
+++ php-src/NEWSFri Apr 13 14:09:20 2007
@@ -12,6 +12,7 @@
   timezone offset). (Derick)
 - Fixed bug #39965 (Latitude and longitude are backwards in date_sun_info()).
   (Derick)
+- Fixed bug #39416 (Milliseconds in date()). (Derick)
 
 
 10 Apr 2007, PHP 5.2.2RC1
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.44r2=1.43.2.45.2.45diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.44 
php-src/ext/date/php_date.c:1.43.2.45.2.45
--- php-src/ext/date/php_date.c:1.43.2.45.2.44  Fri Apr 13 08:33:48 2007
+++ php-src/ext/date/php_date.c Fri Apr 13 14:09:20 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.44 2007/04/13 08:33:48 derick Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.45 2007/04/13 14:09:20 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -25,6 +25,7 @@
 #include php_ini.h
 #include ext/standard/info.h
 #include ext/standard/php_versioning.h
+#include ext/standard/php_math.h
 #include php_date.h
 #include lib/timelib.h
 #include time.h
@@ -792,6 +793,7 @@
case 'H': length = slprintf(buffer, 32, %02d, (int) 
t-h); break;
case 'i': length = slprintf(buffer, 32, %02d, (int) 
t-i); break;
case 's': length = slprintf(buffer, 32, %02d, (int) 
t-s); break;
+   case 'u': length = slprintf(buffer, 32, %06d, (int) 
floor(t-f * 100)); break;
 
/* timezone */
case 'I': length = slprintf(buffer, 32, %d, localtime 
? offset-is_dst : 0); break;

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c

2007-01-03 Thread Derick Rethans
derick  Wed Jan  3 14:46:24 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/date   php_date.c 
  Log:
  - Fixed bug #40012 (php_date.c doesnt compile on Netware).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.469r2=1.2027.2.547.2.470diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.469 php-src/NEWS:1.2027.2.547.2.470
--- php-src/NEWS:1.2027.2.547.2.469 Tue Jan  2 15:29:09 2007
+++ php-src/NEWSWed Jan  3 14:46:23 2007
@@ -17,6 +17,8 @@
   __inet_pton() and inet_ntop() was named __inet_ntop(). (Hannes)
 - Fixed the validate email filter so that the letter v can also be used in
   the user part of the email address. (Derick)
+- Fixed bug #40012 (php_date.c doesnt compile on Netware). (gk at gknw dot de,
+  Derick)
 - Fixed bug #39984 (redirect response code in header() could be ignored in
   CGI sapi). (Ilia)
 - Fixed bug #39971 (pg_insert/pg_update do not allow now() to be used for
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.37r2=1.43.2.45.2.38diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.37 
php-src/ext/date/php_date.c:1.43.2.45.2.38
--- php-src/ext/date/php_date.c:1.43.2.45.2.37  Mon Jan  1 09:35:48 2007
+++ php-src/ext/date/php_date.c Wed Jan  3 14:46:23 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.37 2007/01/01 09:35:48 sebastian Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.38 2007/01/03 14:46:23 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -623,6 +623,14 @@
}
return tzid;
}
+#elif defined(NETWARE)
+   /* Try to guess timezone from system information */
+   {
+   char *tzid = timelib_timezone_id_from_abbr(, ((_timezone * 
-1) + (daylightOffset * daylightOnOff)), daylightOnOff);
+   if (tzid) {
+   return tzid;
+   }
+   }
 #endif
/* Fallback to UTC */
php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG We had to 
select 'UTC' because your platform doesn't provide functionality for the 
guessing algorithm);
@@ -2061,7 +2069,7 @@
 PHP_FUNCTION(timezone_name_from_abbr)
 {
char*abbr;
-   char*tzname;
+   char*tzid;
int  abbr_len;
long gmtoffset = -1;
long isdst = -1;
@@ -2069,10 +2077,10 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|ll, abbr, 
abbr_len, gmtoffset, isdst) == FAILURE) {
RETURN_FALSE;
}
-   tzname = timelib_timezone_id_from_abbr(abbr, gmtoffset, isdst);
+   tzid = timelib_timezone_id_from_abbr(abbr, gmtoffset, isdst);
 
-   if (tzname) {
-   RETURN_STRING(tzname, 1);
+   if (tzid) {
+   RETURN_STRING(tzid, 1);
} else {
RETURN_FALSE;
}

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c

2006-12-22 Thread Ilia Alshanetsky
iliaa   Fri Dec 22 15:21:34 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date   php_date.c 
/php-srcNEWS 
  Log:
  Small optimization of the date() function
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.35r2=1.43.2.45.2.36diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.35 
php-src/ext/date/php_date.c:1.43.2.45.2.36
--- php-src/ext/date/php_date.c:1.43.2.45.2.35  Mon Dec 11 21:04:40 2006
+++ php-src/ext/date/php_date.c Fri Dec 22 15:21:34 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.35 2006/12/11 21:04:40 iliaa Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.36 2006/12/22 15:21:34 iliaa Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -704,7 +704,7 @@
 static char *date_format(char *format, int format_len, timelib_time *t, int 
localtime)
 {
smart_strstring = {0};
-   int  i;
+   int  i, length;
char buffer[33];
timelib_time_offset *offset = NULL;
timelib_sll  isoweek, isoyear;
@@ -735,72 +735,71 @@
offset = timelib_get_time_zone_info(t-sse, t-tz_info);
}
}
-   buffer[32] = '\0';
timelib_isoweek_from_date(t-y, t-m, t-d, isoweek, isoyear);
 
for (i = 0; i  format_len; i++) {
switch (format[i]) {
/* day */
-   case 'd': snprintf(buffer, 32, %02d, (int) t-d); 
break;
-   case 'D': snprintf(buffer, 32, %s, 
php_date_short_day_name(t-y, t-m, t-d)); break;
-   case 'j': snprintf(buffer, 32, %d, (int) t-d); break;
-   case 'l': snprintf(buffer, 32, %s, 
php_date_full_day_name(t-y, t-m, t-d)); break;
-   case 'S': snprintf(buffer, 32, %s, 
english_suffix(t-d)); break;
-   case 'w': snprintf(buffer, 32, %d, (int) 
timelib_day_of_week(t-y, t-m, t-d)); break;
-   case 'N': snprintf(buffer, 32, %d, (int) 
timelib_iso_day_of_week(t-y, t-m, t-d)); break;
-   case 'z': snprintf(buffer, 32, %d, (int) 
timelib_day_of_year(t-y, t-m, t-d)); break;
+   case 'd': length = snprintf(buffer, 32, %02d, (int) 
t-d); break;
+   case 'D': length = snprintf(buffer, 32, %s, 
php_date_short_day_name(t-y, t-m, t-d)); break;
+   case 'j': length = snprintf(buffer, 32, %d, (int) 
t-d); break;
+   case 'l': length = snprintf(buffer, 32, %s, 
php_date_full_day_name(t-y, t-m, t-d)); break;
+   case 'S': length = snprintf(buffer, 32, %s, 
english_suffix(t-d)); break;
+   case 'w': length = snprintf(buffer, 32, %d, (int) 
timelib_day_of_week(t-y, t-m, t-d)); break;
+   case 'N': length = snprintf(buffer, 32, %d, (int) 
timelib_iso_day_of_week(t-y, t-m, t-d)); break;
+   case 'z': length = snprintf(buffer, 32, %d, (int) 
timelib_day_of_year(t-y, t-m, t-d)); break;
 
/* week */
-   case 'W': snprintf(buffer, 32, %02d, (int) isoweek); 
break; /* iso weeknr */
-   case 'o': snprintf(buffer, 32, %d, (int) isoyear); 
break; /* iso year */
+   case 'W': length = snprintf(buffer, 32, %02d, (int) 
isoweek); break; /* iso weeknr */
+   case 'o': length = snprintf(buffer, 32, %d, (int) 
isoyear); break; /* iso year */
 
/* month */
-   case 'F': snprintf(buffer, 32, %s, 
mon_full_names[t-m - 1]); break;
-   case 'm': snprintf(buffer, 32, %02d, (int) t-m); 
break;
-   case 'M': snprintf(buffer, 32, %s, 
mon_short_names[t-m - 1]); break;
-   case 'n': snprintf(buffer, 32, %d, (int) t-m); break;
-   case 't': snprintf(buffer, 32, %d, (int) 
timelib_days_in_month(t-y, t-m)); break;
+   case 'F': length = snprintf(buffer, 32, %s, 
mon_full_names[t-m - 1]); break;
+   case 'm': length = snprintf(buffer, 32, %02d, (int) 
t-m); break;
+   case 'M': length = snprintf(buffer, 32, %s, 
mon_short_names[t-m - 1]); break;
+   case 'n': length = snprintf(buffer, 32, %d, (int) 
t-m); break;
+   case 't': length = snprintf(buffer, 32, %d, (int) 
timelib_days_in_month(t-y, t-m)); break;
 
/* year */
-   case 'L': snprintf(buffer, 32, %d, 
timelib_is_leap((int) t-y)); break;
-   case 'y': snprintf(buffer, 32, %02d, (int) t-y % 
100); break;
-   case 'Y': snprintf(buffer, 32, %04d, (int) t-y); 
break;
+   

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/tests bug39782.phpt

2006-12-11 Thread Ilia Alshanetsky
iliaa   Mon Dec 11 21:04:40 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/date/tests bug39782.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/date   php_date.c 
  Log:
  Fixed bug #39782 (setTime() on a DateTime constructed with a Weekday  
  yields incorrect results).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.424r2=1.2027.2.547.2.425diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.424 php-src/NEWS:1.2027.2.547.2.425
--- php-src/NEWS:1.2027.2.547.2.424 Mon Dec 11 14:54:14 2006
+++ php-src/NEWSMon Dec 11 21:04:40 2006
@@ -54,6 +54,8 @@
   multipliers). (Ilia)
 - Fixed bug #39787 (PHP doesn't work with Apache 2.3). (mv at binarysec dot
   com).
+- Fixed bug #39782 (setTime() on a DateTime constructed with a Weekday
+  yields incorrect results). (Ilia)
 - Fixed bug #39780 (PNG image with CRC/data error raises fatal error) (Pierre)
 - Fixed bug #39775 (Indirect modification ... message is not shown). (Dmitry)
 - Fixed bug #39763 (magic quotes are applied twice by ext/filter in
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.34r2=1.43.2.45.2.35diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.34 
php-src/ext/date/php_date.c:1.43.2.45.2.35
--- php-src/ext/date/php_date.c:1.43.2.45.2.34  Mon Nov  6 16:11:26 2006
+++ php-src/ext/date/php_date.c Mon Dec 11 21:04:40 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.34 2006/11/06 16:11:26 bjori Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.35 2006/12/11 21:04:40 iliaa Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -1643,6 +1643,8 @@
timelib_fill_holes(dateobj-time, now, 0);
timelib_update_ts(dateobj-time, tzi);
 
+   dateobj-time-have_weekday_relative = dateobj-time-have_relative = 0;
+
if (now-tz_info != tzi) {
timelib_tzinfo_dtor(now-tz_info);
}

http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug39782.phpt?view=markuprev=1.1
Index: php-src/ext/date/tests/bug39782.phpt
+++ php-src/ext/date/tests/bug39782.phpt

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c

2006-08-22 Thread Ilia Alshanetsky
iliaa   Tue Aug 22 16:47:23 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date   php_date.c 
/php-srcNEWS 
  Log:
  Fixed bug #38511, #38473, #38263 (Fixed session extension request shutdown  
  order to ensure it is shutdown before the extensions it may depend on).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.25r2=1.43.2.45.2.26diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.25 
php-src/ext/date/php_date.c:1.43.2.45.2.26
--- php-src/ext/date/php_date.c:1.43.2.45.2.25  Tue Aug 15 06:53:21 2006
+++ php-src/ext/date/php_date.c Tue Aug 22 16:47:23 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.25 2006/08/15 06:53:21 mike Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.26 2006/08/22 16:47:23 iliaa Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -299,9 +299,17 @@
 static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC);
 static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC);
 
+/* This is need to ensure that session extension request shutdown occurs 1st, 
because it uses the date extension */ 
+static zend_module_dep date_deps[] = {
+ZEND_MOD_OPTIONAL(session)
+{NULL, NULL, NULL}
+};
+
 /* {{{ Module struct */
 zend_module_entry date_module_entry = {
-   STANDARD_MODULE_HEADER,
+   STANDARD_MODULE_HEADER_EX,
+   NULL,
+   date_deps,
date, /* extension name */
date_functions, /* function list */
PHP_MINIT(date),/* process startup */
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.214r2=1.2027.2.547.2.215diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.214 php-src/NEWS:1.2027.2.547.2.215
--- php-src/NEWS:1.2027.2.547.2.214 Tue Aug 22 12:04:53 2006
+++ php-src/NEWSTue Aug 22 16:47:23 2006
@@ -7,6 +7,9 @@
   inside a failed query executed via query() method). (Ilia)
 - Fixed bug #38524 (strptime() does not initialize the internal date storage
   structure). (Ilia)
+- Fixed bug #38511, #38473, #38263 (Fixed session extension request shutdown
+  order to ensure it is shutdown before the extensions it may depend on).
+  (Ilia)
 - Fixed bug #38488 (Access to php://stdin and family crashes PHP on win32).
   (Dmitry)
 - Fixed PECL bug #8112 (OCI8 persistent connections misbehave when Apache 

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/tests bug37616.phpt date_constants.phpt

2006-05-30 Thread Derick Rethans
derick  Tue May 30 13:12:21 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/date/tests bug37616.phpt date_constants.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/date   php_date.c 
  Log:
  - MFH: Fixed bug #37616: DATE_RFC822 does not product RFC 822 dates. (Patch by
Hannes Magnusson)
  
  http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.63r2=1.2027.2.547.2.64diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.63 php-src/NEWS:1.2027.2.547.2.64
--- php-src/NEWS:1.2027.2.547.2.63  Mon May 29 20:07:39 2006
+++ php-src/NEWSTue May 30 13:12:21 2006
@@ -48,6 +48,8 @@
 - Fixed memory leaks in openssl streams context options (Pierre)
 - Fixed handling of extremely long paths inside tempnam() function. (Ilia)
 - Fixed bug #37632 (Protected method access problem). (Marcus)
+- Fixed bug #37616: DATE_RFC822 does not product RFC 822 dates. (Hannes
+  Magnusson, Derick)
 - Fixed bug #37620 (mysqli_ssl_set validation is innappropriate). (Georg)
 - Fixed bug #37614 (Class name lowercased in error message). (Johannes)
 - Fixed bug #37587 (var without attribute causes segfault). (Marcus)
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.3r2=1.43.2.45.2.4diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.3 
php-src/ext/date/php_date.c:1.43.2.45.2.4
--- php-src/ext/date/php_date.c:1.43.2.45.2.3   Sun May 14 17:35:56 2006
+++ php-src/ext/date/php_date.c Tue May 30 13:12:21 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.3 2006/05/14 17:35:56 derick Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.4 2006/05/30 13:12:21 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -237,11 +237,87 @@
 
 #define DATE_TIMEZONEDB  php_date_global_timezone_db ? 
php_date_global_timezone_db : timelib_builtin_db()
 
+/*
+ * RFC822, Section 5.1: http://www.ietf.org/rfc/rfc822.txt
+ *  date-time   =  [ day , ] date time; dd mm yy hh:mm:ss zzz
+ *  day =  Mon  / Tue /  Wed  / Thu  /  Fri  / Sat /  Sun
+ *  date=  1*2DIGIT month 2DIGIT; day month year e.g. 20 Jun 82
+ *  month   =  Jan  /  Feb /  Mar  /  Apr  /  May  /  Jun /  
Jul  /  Aug  /  Sep  /  Oct /  Nov  /  Dec
+ *  time=  hour zone; ANSI and Military
+ *  hour=  2DIGIT : 2DIGIT [: 2DIGIT] ; 00:00:00 - 23:59:59
+ *  zone=  UT  / GMT  /  EST / EDT  /  CST / CDT  /  MST 
/ MDT  /  PST / PDT  /  1ALPHA  / ( (+ / -) 4DIGIT )
+ */
+#define DATE_FORMAT_RFC822   D, d M y H:i:s O
+
+/*
+ * RFC850, Section 2.1.4: http://www.ietf.org/rfc/rfc850.txt
+ *  Format must be acceptable both to the ARPANET and to the getdate routine.
+ *  One format that is acceptable to both is Weekday, DD-Mon-YY HH:MM:SS 
TIMEZONE
+ *  TIMEZONE can be any timezone name (3 or more letters)
+ */
+#define DATE_FORMAT_RFC850   l, d-M-y H:i:s T
+
+/*
+ * RFC1036, Section 2.1.2: http://www.ietf.org/rfc/rfc1036.txt
+ *  Its format must be acceptable both in RFC-822 and to the getdate(3)
+ *  Wdy, DD Mon YY HH:MM:SS TIMEZONE
+ *  There is no hope of having a complete list of timezones.  Universal
+ *  Time (GMT), the North American timezones (PST, PDT, MST, MDT, CST,
+ *  CDT, EST, EDT) and the +/-hhmm offset specifed in RFC-822 should be 
supported.
+ */
+#define DATE_FORMAT_RFC1036  D, d M y H:i:s O
+
+/*
+ * RFC1123, Section 5.2.14: http://www.ietf.org/rfc/rfc1123.txt
+ *  RFC-822 Date and Time Specification: RFC-822 Section 5
+ *  The syntax for the date is hereby changed to: date = 1*2DIGIT month 
2*4DIGIT
+ */
+#define DATE_FORMAT_RFC1123  D, d M Y H:i:s O
+
+/*
+ * RFC2822, Section 3.3: http://www.ietf.org/rfc/rfc2822.txt
+ *  FWS =   ([*WSP CRLF] 1*WSP) /   ; Folding white space
+ *  CFWS=   *([FWS] comment) (([FWS] comment) / FWS)
+ *  
+ *  date-time   =   [ day-of-week , ] date FWS time [CFWS]
+ *  day-of-week =   ([FWS] day-name)
+ *  day-name=   Mon / Tue / Wed / Thu / Fri / Sat / 
Sun
+ *  date=   day month year
+ *  year=   4*DIGIT
+ *  month   =   (FWS month-name FWS)
+ *  month-name  =   Jan / Feb / Mar / Apr / May / Jun / 
Jul / Aug / Sep / Oct / Nov / Dec
+ *  day =   ([FWS] 1*2DIGIT)
+ *  time=   time-of-day FWS zone
+ *  time-of-day =   hour : minute [ : second ]
+ *  hour=   2DIGIT
+ *  minute  =   2DIGIT
+ *  second  =   2DIGIT
+ *  zone=   (( + / - ) 4DIGIT)
+ */
+#define DATE_FORMAT_RFC2822  D, d M Y H:i:s O
+/*
+ * RFC3339, Section 5.6: http://www.ietf.org/rfc/rfc3339.txt
+ *  date-fullyear   = 4DIGIT
+ *  date-month  = 2DIGIT  ; 01-12
+ *  date-mday   = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31 based on month/year
+ *  
+ *