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

Quotes not being escaped/unescaped correctly in Oracle database - data getting mangled!

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Not a bug
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.7.2, 1.8
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Environment:
      Moodle 1.7+ running on Ubuntu Dapper Drake/PHP5/Apache2

      Description

      Hi.

      First note: I initially thought this was a problem only with the WYSIWYG HTML editor (and raised an issue MDL-8468 regarding this). Since then I have found that it affects any string I have entered into the Moodle site.

      We are using an Oracle database as our main back-end (new OCI8PO functionality in Oracle 7). It has worked OK, except that any double-quote characters are not being escaped correctly, and are being left with a leading backslash after being saved to the database. This was first spotted in HTML tag attributes:

      <tag attrib="value">
      becomes
      <tag attrib=\"value\">

      Additionally, any time that we edit this again, another two backslashes are added. So (unless we modify the above), on the next edit it would become:
      <tag attrib=\\\"value\\\">

      This has also affected other things, for example we have a sandbox course available named "doodle" (where our lecturers can play about) - the course name itself has exhibited this incorrect escaping (and is displaying as \\\"doodle\\\").

      I've looked into the raw database and seen that the strings are being saved in this incorrect escaped form.

      If anybody would like to investigate our site as part of the support process, I have set the Qube "Doodle" course on our Moodle installation http://qube.harlow-college.ac.uk to allow guest access. The course exists within the category "Qube for Staff".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              cfowler Craig Fowler
              Tester:
              Nobody
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                30/Mar/07