Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Mar 2004 19:12:48 +0200 (CEST)
From:      Martin Matuska <martin@tradex.sk>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        ale@FreeBSD.org
Subject:   ports/64899: DST related datetime bug in PHP 4.3.5
Message-ID:  <20040329171248.12FC8A921@mail.tradex.sk>
Resent-Message-ID: <200403291720.i2THKEvk059059@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         64899
>Category:       ports
>Synopsis:       DST related datetime bug in PHP 4.3.5
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 29 09:20:14 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 4.9-RELEASE-p4 i386
>Organization:
>Environment:
System: FreeBSD 4.9-RELEASE-p4 
>Description:
	Serious DST related time reporting bug in PHP4 ver 4.3.5 
	ext/standard/datetime.c ver. 1.96.2.12
	http://bugs.php.net/bug.php?id=27719

	See PHP4 CVS for fix of ext/standard/datetime.c ver. 1.96.2.13
	http://cvs.php.net/cvs.php/php-src/ext/standard/datetime.c
	
>How-To-Repeat:
>Fix:
diff -Nbur php4_orig/Makefile php4/Makefile
--- php4_orig/Makefile	Mon Mar 29 19:02:44 2004
+++ php4/Makefile	Mon Mar 29 19:02:51 2004
@@ -21,7 +21,7 @@
 
 PORTNAME=	php4
 PORTVERSION=	4.3.5
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES?=	lang devel www
 MASTER_SITES=	http://www.php.net/distributions/:release \
 		http://it.php.net/distributions/:release \
diff -Nbur php4_orig/files/patch-ext::standard::datetime.c php4/files/patch-ext::standard::datetime.c
--- php4_orig/files/patch-ext::standard::datetime.c	Thu Jan  1 01:00:00 1970
+++ php4/files/patch-ext::standard::datetime.c	Mon Mar 29 18:54:04 2004
@@ -0,0 +1,27 @@
+--- ext/standard/datetime.c.orig	Mon Mar 29 18:52:50 2004
++++ ext/standard/datetime.c	Mon Mar 29 18:53:46 2004
+@@ -19,7 +19,7 @@
+  */
+ 
+ 
+-/* $Id: datetime.c,v 1.96.2.12 2004/03/12 17:27:55 rasmus Exp $ */
++/* $Id: datetime.c,v 1.96.2.13 2004/03/26 19:29:31 rasmus Exp $ */
+ 
+ 
+ #include "php.h"
+@@ -194,12 +194,12 @@
+ 		val = (*arguments[0])->value.lval; 
+ 		/* 
+ 		   We don't use 1 here to work around problems in some mktime implementations
+-		   when it comes to daylight savings time.  Setting it to 2 and working back from
++		   when it comes to daylight savings time.  Setting it to 4 and working back from
+ 		   there with the chgsecs offset makes us immune to these problems.  
+ 		   See http://bugs.php.net/27533 for more info.
+ 		*/
+-		if (val < 2) { 
+-			chgsecs += (2-val) * 60*60; val = 2; 
++		if (val < 4) { 
++			chgsecs += (4-val) * 60*60; val = 4; 
+ 		} 
+ 		ta->tm_hour = val; 
+ 		/* fall-through */ 
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040329171248.12FC8A921>