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

addslashes missing in cvs:/mod/quiz/format/multianswer/format.php

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      All
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_15_STABLE

      Description

      Addslashes is missing on line 30 in http://moodle.cvs.sourceforge.net/moodle/moodle/mod/quiz/format/multianswer/format.php.

      When the ' sign is present in the question, Moodle writes Could not insert new question! error and does not insert the question into database.

      original line 30:

      $thequestion->name = $lines[0];

      corrected line 30:

      $thequestion->name = addslashes($lines[0]);

      It would be nice to have the questions name limited to e.g. 30 characters, it can become very long now.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            dougiamas Martin Dougiamas added a comment -

            From Howard Miller (howard.miller at udcf.gla.ac.uk) Friday, 26 August 2005, 07:02 PM:

            In testing this I noticed that this format generates some notices as well. I will endeavour to fix all of the issues before closing this.

            From Howard Miller (howard.miller at udcf.gla.ac.uk) Friday, 26 August 2005, 08:02 PM:

            addslashes added as noted. Also fixed a bug with notice being thrown.

            Thanks!

            Show
            dougiamas Martin Dougiamas added a comment - From Howard Miller (howard.miller at udcf.gla.ac.uk) Friday, 26 August 2005, 07:02 PM: In testing this I noticed that this format generates some notices as well. I will endeavour to fix all of the issues before closing this. From Howard Miller (howard.miller at udcf.gla.ac.uk) Friday, 26 August 2005, 08:02 PM: addslashes added as noted. Also fixed a bug with notice being thrown. Thanks!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: