Siggen header error

A signature and avatar generator addon

Moderator: zanix

Siggen header error

Postby evillotjuh » Mon Oct 22, 2007 9:38 pm

After some complains from my guild's forum users about the signatures, I started debugging the problem.
It seemed that some sigs didn't display anymore as soon as they were cached by the browser. I checked the headers and it seemed that the If-Modified-Since header was set to: Wed, 31 Dec 1969 23:59:59 GMT
Obviously this isn't a valid date at all.

After some code digging I found the following bug:
At row 357 from siggen.php the $DTS variable is set to: strtotime($sig_updated.$configData['db_ver'])

First of all why is $configData['db_ver'] appended to the date here!?!?
And second, strtotime expects you to give him a valid date string according to the GNU Date Input Formats syntax. The way the date is stored to the database does not match this syntax so strtotime will return -1 (or FALSE)

Here is my fix:
Code: Select all
188c188
<       $players_str = 'SELECT * FROM `'.ROSTER_PLAYERSTABLE."` WHERE `member_id` = '$member_id';";
---
>       $players_str = 'SELECT *, STR_TO_DATE(`dateupdatedutc`, \'%m/%d/%y %H:%i:%s\') AS `dateupdatedutc` FROM `'.ROSTER_PLAYERSTABLE."` WHERE `member_id` = '$member_id';";
357c357
<               $DTS = strtotime($sig_updated.$configData['db_ver']);
---
>               $DTS = strtotime($sig_updated);
evillotjuh
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Mon Oct 22, 2007 9:19 pm

Siggen header error

Postby zanix » Tue Oct 23, 2007 12:07 am

Wow, I haven't looked at this part of the code for over a year now...
I wonder why the db_ver is there too???
Last edited by zanix on Tue Oct 23, 2007 12:08 am, edited 1 time in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Siggen header error

Postby evillotjuh » Fri Oct 26, 2007 6:57 pm

You might want to check the beta SigGen too, since it seems to have the wrong headers as well:
Expires: Thu, 19 Nov 1981 08:52:00 GMT
For a new generated image?
evillotjuh
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Mon Oct 22, 2007 9:19 pm

Siggen header error

Postby zanix » Sat Oct 27, 2007 12:02 am

I'll be sure to take a look at it before I stamp FINAL on the zip package
I will be making another beta release of SigGen before 0.3.0 final is out
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Siggen header error

Postby zanix » Thu Nov 29, 2007 2:54 pm

Fixed in v0.3.0.320
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US


Return to SigGen

Who is online

Users browsing this forum: No registered users and 1 guest

cron