date_default_timezone_set() used in module.graphic.jpg.php

Locked
niekkouwenberg
User
Posts:1
Joined:Tue Mar 05, 2013 2:36 pm
Are you a spambot?:no
date_default_timezone_set() used in module.graphic.jpg.php

Post by niekkouwenberg » Tue Mar 05, 2013 2:45 pm

In the getid3_jpg class, the method date_default_timezone_set() is used. This will overwrite the application set timezone and should therefore be removed.
If a UTF timezone is required, the original timezone should be restored after this function.
Possibly gmmktime() can be used to prevent timezone toggling?

Class: getid3_jpg
Method: Analyze
File: module.graphic.jpg.php
Lines: 111-115

See also: viewtopic.php?f=15&t=1113&p=3448 where is previous timezone overwrite was removed.

Also; the code in lines 106-109 doesn't seem to do anything, as the $computed_time is overwritten in line 117.

soulhunter
getID3() v1 developer
Posts:40
Joined:Mon Jan 11, 2010 5:37 pm
Are you a spambot?:no
Location:Kaliningrad, Russia
Contact:

Re: date_default_timezone_set() used in module.graphic.jpg.p

Post by soulhunter » Tue Mar 05, 2013 3:09 pm

I agree.

Call to this function (and ini_set()) as an alternative should be removed and mktime() replaced with gmmktime().
And all code in 105-124 lines should be validated, it looks a little strange.

soulhunter
getID3() v1 developer
Posts:40
Joined:Mon Jan 11, 2010 5:37 pm
Are you a spambot?:no
Location:Kaliningrad, Russia
Contact:

Re: date_default_timezone_set() used in module.graphic.jpg.p

Post by soulhunter » Fri Jul 05, 2013 11:56 am

Fixed in https://github.com/JamesHeinrich/getID3/commit/768bf8274db8d5daa475836e52f5827463579f3f

Locked