Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#7455 closed patch (fixed)

timezone caching comparison in mythweb is wrong.

Reported by: frans.meulenbroeks@… Owned by: Rob Smith
Priority: minor Milestone: 0.23
Component: Plugin - MythWeb Version: head
Severity: medium Keywords:
Cc: Ticket locked: no


problem: changes in timezone are never taken over by mythtv.

"./classes/MythBackend.php" line 113 of 217 and next read:

public function setTimezone() {

if (!is_string($_SESSIONbackend?timezone?value?)
$_SESSIONbackend?timezone?last_check_time? - time() > 60*60*24) {

$response = $this->sendCommand('QUERY_TIME_ZONE'); $timezone = str_replace(' ', '_', $response[0]); $_SESSIONbackend?timezone?value? = $timezone; $_SESSIONbackend?timezone?last_check_time? = time();


This comparison:

$_SESSIONbackend?timezone?last_check_time? - time() > 60*60*24)

will normally yield a negative value as time() is later (and thus bigger0 than the last checked time so once a value is set it will never be re-checked.

Solution is simple: change into

time() - $_SESSIONbackend?timezone?last_check_time? > 60*60*24)

Btw: it would be nice if the system be forced to reread the timezone (people typically note it is wrong; change the settings but now have to wait 24hrs before the change takes effect)

Change History (2)

comment:1 Changed 11 years ago by sphery

Resolution: fixed
Status: newclosed

(In [23624]) Fix the MythWeb time-zone-caching comparison so that we re-check the time zone each day.

Fixes #7455 with patch from Frans.

comment:2 Changed 11 years ago by sphery

Milestone: unknown0.23
Note: See TracTickets for help on using tickets.