View Issue Details

IDProjectCategoryView StatusLast Update
0005482OXID eShop (all versions)1.03. Basket, checkout processpublic2015-12-01 10:25
Status acknowledgedResolutionopen 
Platform32bitOSOS Version
Product Version4.7.8 / 5.0.8 
Target VersionFixed in Version 
Summary0005482: Voucher validity check fails on 32bit system with end dates greater than "2038-01-19 03:14:07"
DescriptionThe database allows dates like "2060-01-01 00:00:00" on 32bit systems. However if you use strtotime to convert this date to a timestamp on a 32bit systems, this function fails.

As oxVoucher::_isValidDate() uses strtotime to validate the date, this fails as well.

This can happen if voucher series are generated automatically, e.g. by an importer script.
Steps To Reproduce* install shop on a 32bit system
* create voucher serie by script, including the line
  $oVoucherSerie->oxvoucherseries__oxenddate = new oxField('2060-01-01 00:00:00');
* create some vouchers
* try to use one
Additional InformationThis bug can be fixed by using the DateTime class and its "diff" method. By testing the sign of the resulting difference ($diff->format('%R')), you get the necessary data.

"strtotime" is probably used all over the source code, so there will be more bugs like this elsewhere.
ThemeNot defined
PHP VersionNot defined
Database VersionNot defined



2015-06-02 10:04

reporter   ~0011004

In EE 5.2.4 strtotime is only used in three models (oxactions, oxorderfile and oxvoucher) so it is not "used all over the source code".