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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.4, 1.9
    • Fix Version/s: 1.8.5, 1.9
    • Component/s: Enrolments
    • Labels:
      None
    • Environment:
      All (but specifically PHP 4.4.4), code fragment also fails under Windows Vista/Apache 2/PHP 5.2.5
    • Rank:
      30732

      Description

      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.

        Activity

        Hide
        Alan Barrett added a comment -

        Error introduced on Nov 20th to MOODLE_18_STABLE when revision 1.15.2.1 upgraded to revision 1.15.2.2 (line 59)...

        http://cvs.moodle.org/moodle/enrol/authorize/enrol_form.php?r1=1.15.2.1&r2=1.15.2.2

        Same change also made to following two branches...
        http://cvs.moodle.org/moodle/enrol/authorize/enrol_form.php?r1=1.16&r2=1.16.2.1 (MOODLE_19_STABLE)
        http://cvs.moodle.org/moodle/enrol/authorize/enrol_form.php?r1=2.2&r2=2.3 (MAIN)

        Show
        Alan Barrett added a comment - Error introduced on Nov 20th to MOODLE_18_STABLE when revision 1.15.2.1 upgraded to revision 1.15.2.2 (line 59)... http://cvs.moodle.org/moodle/enrol/authorize/enrol_form.php?r1=1.15.2.1&r2=1.15.2.2 Same change also made to following two branches... http://cvs.moodle.org/moodle/enrol/authorize/enrol_form.php?r1=1.16&r2=1.16.2.1 (MOODLE_19_STABLE) http://cvs.moodle.org/moodle/enrol/authorize/enrol_form.php?r1=2.2&r2=2.3 (MAIN)
        Hide
        No Body added a comment -

        Fixed

        Show
        No Body added a comment - Fixed
        Hide
        Martin Dougiamas added a comment -

        Fixing the version information for this bug.

        Show
        Martin Dougiamas added a comment - Fixing the version information for this bug.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: