Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12958

In the Authorize enrol plug-in when a credit card expiry date (year) is entered, a validate error is generated blocking credit card usage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.8.5, 1.9
    • 1.8.4, 1.9
    • Enrolments
    • None
    • All (but specifically PHP 4.4.4), code fragment also fails under Windows Vista/Apache 2/PHP 5.2.5

      In the Authorize enrol plug-in when a credit card expiry date (year) is entered, a validate error is generated blocking credit card usage. This applies to 1.8.4 and 1.8.4+. This is caused because validation() and also enrol.php expectes the field ccexpireyyyy to be of the form yyyy, actually the current code generates a single digit starting from 0,1,2...

      The fix in enrol/authorize/enrol_form.php is as follows...

      // $yearsmenu = array('' => get_string('choose')) + range($nowdate["year"] - 1, $nowdate["year"] + 15);
      // Above line replaced by ALAN with following 5 lines
      $yearsmenu = array('' => get_string('choose'));
      $nowyear = $nowdate["year"] - 1;
      for ($i = $nowyear; $i <= $nowyear + 16; $i++)

      { $yearsmenu[$i] = $i; }

      This more or less reverts the code to the way it was in a previous version (1.8.3+).

      The index value that is returned by HTML form submission has to be a year value and not 0,1,2 etc. (e.g. $nowyear['2007'] = '2007', NOT $nowyear[0] = '2007').

      URL describing bug attached.
      Fixed file attached (enrol/authorize/enrol_form.php [line 59]).

      Alan.

            deneme No Body
            alanbarrett Alan Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.