Warning: mktime() expects parm 4 to be long, string given

Discuss about Group-Office development here

Moderator: Developers

User avatar
Mr.Magoo
Posts: 38
Joined: Thu May 14, 2009 5:45 pm

Warning: mktime() expects parm 4 to be long, string given

Postby Mr.Magoo » Wed Jun 24, 2009 11:03 pm

I tried importing an iCalendar .ics holiday file today.
During the import, the following warning was issued multiple times:

Code: Select all

Warning:  mktime() expects parameter 4 to be long, string given in /<GO3_rootdir>/classes/ical2array.class.inc on line 588
The effective code is show below (a large portion of the code is commented out).
The line in error is the last line, in the ELSE branch:

Code: Select all

	function parse_date($date, $timezone_id='')
	{	
		$date=trim($date);
		$year = substr($date,0,4);
		$month = substr($date,4,2);
		$day = substr($date,6,2);

		if (strpos($date, 'T') !== false)
		{
			$hour = substr($date,9,2);
			$min = substr($date,11,2);
			$sec = substr($date,13,2);
		}else
		{
			$hour = 0;
			$min = 0;
			$sec = 0;
		}
		
		if(strpos($date, 'Z'))
			return gmmktime($hour, $min, $sec, $month, $day , $year);
		else		
			return mktime($hour, $min, $sec, $month, $day , $year);
	}
	

As you can see, the reported error occurs in the 4th parameter, $month.
I suspect that somewhere an illegal value for month is passed to mktime(), resulting in the warning.

The iCalender entries where added normally, though.

Someone any idea how to solve this warning??

Mr.Magoo
"People, let's do it to them, before they do it to us!”
...Hillstreet Blues
mschering
Site Admin
Site Admin
Posts: 8332
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Warning: mktime() expects parm 4 to be long, string given

Postby mschering » Thu Jun 25, 2009 6:27 am

Can you post the icalendar file?
Best regards,

Merijn Schering
Intermesh
User avatar
Mr.Magoo
Posts: 38
Joined: Thu May 14, 2009 5:45 pm

Re: Warning: mktime() expects parm 4 to be long, string given

Postby Mr.Magoo » Thu Jun 25, 2009 8:47 am

Yes, I can. And I will.

Here is my Dutch Holiday file in iCalendar format (.ics) ZIP'ed.

Mr.Magoo
Attachments
DutchHolidays.zip
Dutch Holiday file in iCalendar format (.ics)
(2.98 KiB) Downloaded 381 times
"People, let's do it to them, before they do it to us!”
...Hillstreet Blues

Who is online

Users browsing this forum: No registered users and 1 guest

cron