Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Date Handling Incorrect for Old Dates
https://www.tinywebgallery.com/forum/viewtopic.php?f=5&t=3680
Page 1 of 1

Author:  millst [ 8. May 2014, 06:04 ]
Post subject:  Date Handling Incorrect for Old Dates

I have photos dating back to 2000. I start getting errors with files/folders sometime in 2001. Here is an example in filefunctions.inc.php (around line 912):

$locverzeichnisse[$x] = substr($locverzeichnisse[$x], 11);

The date is assumed to be 11 characters long. This isn't true for older dates. It's done in several other areas of the code.

-tm

Author:  TinyWebGallery [ 8. May 2014, 13:08 ]
Post subject:  Re: Date Handling Incorrect for Old Dates

Right. This was implemented this way.
If you want to fix this you can simply append a leading zero at all this places.

This is only done for sorting.

Best, Michael

Author:  millst [ 18. May 2014, 22:39 ]
Post subject:  Re: Date Handling Incorrect for Old Dates

Extracting everything up to the underscore would have worked for all situations without significant additional complexity. Instead, it fails for old dates and will eventually break when the epoch ticks roll over requiring an additional digit (although that's many decades away).

-tm

Author:  TinyWebGallery [ 19. May 2014, 09:27 ]
Post subject:  Re: Date Handling Incorrect for Old Dates

I just checked the code. There is already an additional digit attached. But for a length of 9 which is wrong because there is a spacer counted as well. I have fixed this is in the code. So it should work in the next update.

Best, Michael

Author:  millst [ 19. May 2014, 17:22 ]
Post subject:  Re: Date Handling Incorrect for Old Dates

Great, thanks. I didn't want to have to patch the code for my setup on every update.

-tm

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/