vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   asia/kolkata timezone not work after update 4.2.5 (https://vborg.vbsupport.ru/showthread.php?t=325494)

xman2014 08-10-2017 07:01 AM

asia/kolkata timezone not work after update 4.2.5
 
i upgrade my forum with 4.2.5
i am from india and after update timezone show incorrect time
my forum timezone set to +5.30 asia/kolkata but display +5. only
my forum time running delay by 30 minutes
please tell me how can i fix it

Dave 08-10-2017 12:05 PM

Are you sure the time on your actual server (NTP) is not running behind?

Stingray27 08-10-2017 04:22 PM

You cannot, its basically a bug.

The changes made for php7 mean it will only work with whole hours, not 0.5 hours.

xman2014 08-10-2017 04:23 PM

Quote:

Originally Posted by Stingray27 (Post 2589264)
You cannot, its basically a bug.

The changes made for php7 mean it will only work with whole hours, not 0.5 hours.

how can i fix it, please help me, i have 2 forum. i have same issue on both forum

Stingray27 08-10-2017 04:26 PM

Quote:

Originally Posted by xman2014 (Post 2589265)
how can i fix it

Quote:

Originally Posted by Stingray27 (Post 2589264)
You cannot, its basically a bug.

It would need core code changes in multiple places I think

xman2014 08-11-2017 05:33 AM

who can make a plugin for me to fix timezone issue on vb4.2.5?
please help me

BirdOPrey5 08-11-2017 08:46 AM

Quote:

Originally Posted by Stingray27 (Post 2589264)
You cannot, its basically a bug.

The changes made for php7 mean it will only work with whole hours, not 0.5 hours.

Quote:

Originally Posted by Stingray27 (Post 2589267)
It would need core code changes in multiple places I think

I'm looking at the code and comparing it to VB 4.2.3 which I assume worked, but all the code I see had hard coded multiplying the offset by 3600 (which is # of seconds in an hour 60*60) so I don't understand where partial hours come into the code.

Can anyone confirm the last version timezones worked correctly? Did they work in 4.2.4?

VB.com thread- https://www.vbulletin.com/forum/foru...r-update-4-2-5 (in case we get a fix.)

EDIT- I have confirmed the partial hours DO work in VB 4.2.4.

--------------- Added [DATE]1502454435[/DATE] at [TIME]1502454435[/TIME] ---------------

OK it seems:

PHP Code:

$vbulletin->userinfo['tzoffset'

is being forced to be an int somewhere in VB 4.2.5.

In VB 4.2.4 it can be a float. 30 minutes would be like 4.5 and 45 minutes would be like 6.25

Still checking code for fix.

--------------- Added [DATE]1502461642[/DATE] at [TIME]1502461642[/TIME] ---------------

OK,

functions.php in the /includes/ directory.

Line 4503:

Code:

$tzos = intval($vbulletin->userinfo['timezoneoffset']);
If you remove intval from the code, the time works (you have to set the timezone again after making this change.

It works in the forum and posts. It does NOT work on calendar events, for some reason there are additional intval() functions in the calculator.

I'm going to look deeper into the security ramifications of removing the intval function from this line but a quick glace I see no problem.

--------------- Added [DATE]1502462449[/DATE] at [TIME]1502462449[/TIME] ---------------

So my final determination is to simply change

Code:

$tzos = intval($vbulletin->userinfo['timezoneoffset']);
to

Code:

$tzos = floatval($vbulletin->userinfo['timezoneoffset']);
on line 4503 of /includes/functions.php to get the time working on most of the site.

Unfortunately I don't see any way to make this a plugin, the manual edit it necessary.

xman2014 08-11-2017 04:04 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2589279)
I'm looking at the code and comparing it to VB 4.2.3 which I assume worked, but all the code I see had hard coded multiplying the offset by 3600 (which is # of seconds in an hour 60*60) so I don't understand where partial hours come into the code.

Can anyone confirm the last version timezones worked correctly? Did they work in 4.2.4?

VB.com thread- https://www.vbulletin.com/forum/foru...r-update-4-2-5 (in case we get a fix.)

EDIT- I have confirmed the partial hours DO work in VB 4.2.4.

--------------- Added [DATE]1502454435[/DATE] at [TIME]1502454435[/TIME] ---------------

OK it seems:

PHP Code:

$vbulletin->userinfo['tzoffset'

is being forced to be an int somewhere in VB 4.2.5.

In VB 4.2.4 it can be a float. 30 minutes would be like 4.5 and 45 minutes would be like 6.25

Still checking code for fix.

--------------- Added [DATE]1502461642[/DATE] at [TIME]1502461642[/TIME] ---------------

OK,

functions.php in the /includes/ directory.

Line 4503:

Code:

$tzos = intval($vbulletin->userinfo['timezoneoffset']);
If you remove intval from the code, the time works (you have to set the timezone again after making this change.

It works in the forum and posts. It does NOT work on calendar events, for some reason there are additional intval() functions in the calculator.

I'm going to look deeper into the security ramifications of removing the intval function from this line but a quick glace I see no problem.

--------------- Added [DATE]1502462449[/DATE] at [TIME]1502462449[/TIME] ---------------

So my final determination is to simply change

Code:

$tzos = intval($vbulletin->userinfo['timezoneoffset']);
to

Code:

$tzos = floatval($vbulletin->userinfo['timezoneoffset']);
on line 4503 of /includes/functions.php to get the time working on most of the site.

Unfortunately I don't see any way to make this a plugin, the manual edit it necessary.

Thanks its work for me.
now time is working perfect but timezone steel show +5
i want to display timezone +5.30

BirdOPrey5 08-12-2017 01:52 PM

Quote:

Originally Posted by xman2014 (Post 2589287)
Thanks its work for me.
now time is working perfect but timezone steel show +5
i want to display timezone +5.30

Where is it displaying this? Screenshot?

Paul M 08-12-2017 05:47 PM

Its a bug.

The code was changed in multiple places due to changes in php 7.1
Unfortunately it wasnt realised that some timezones use 0.5 hours, so intval was used.

This issue wasnt noticed until now, so too late to fix.
As above, the fix would probably be to update all the changes to use floatval.


All times are GMT. The time now is 04:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01054 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete