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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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.

        Attachments

          Activity

            People

            • Assignee:
              deneme No Body
              Reporter:
              alanbarrett Alan Barrett
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08