devilslabphp / phpshop

Automatically exported from code.google.com/p/phpshop
0 stars 0 forks source link

Bad date submittion of credit card's expiration date. #13

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've found a bug on phpshop 0.8.1. The problem is that the submitted expire
date of the credit card provided by the user in the Payment Information
page is wrong. The date that goes to the database is one year ahead of the
one selected by the user. After a little investigation I've found a fix,
the problem is with function list_year from admin/lib/ps_html.inc:

   function list_year($list_name) {
        $year = date("Y",time()); 
        $arr = array(); 
        for ($i=0; $i < 7; $i++) { 
          $arr[$year] = $year++; 
        } 
       $this->dropdown_display($list_name, "", $arr);
       return 1;
   }

This produces a list where arr[2009] = 2010. 
The solution which worked for me is: 

   function list_year($list_name) {
        $year = date("Y",time()); 
        $arr = array(); 
        for ($i=0; $i < 7; $i++) { 
          $arr[$year] = $year;
          $year++;
        } 
       $this->dropdown_display($list_name, "", $arr);
       return 1;
   } 

Hope this issue is fixed in the next release. Thanks!

Original issue reported on code.google.com by lucianolev on 6 Jan 2009 at 10:14

GoogleCodeExporter commented 8 years ago

Original comment by edikon on 16 Feb 2009 at 2:51