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

Missing single quotes on a query in accesslib makes the home page crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Libraries
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      At line 1405 there were missing quotes arounf the {$context->id} variable: when it is empty it makes the query crash and the XML Parser throws an error...

      $sql = "SELECT ctx.path, rc.roleid, rc.capability, rc.permission
      FROM {$CFG->prefix}role_capabilities rc
      JOIN {$CFG->prefix}context ctx
      ON rc.contextid=ctx.id
      WHERE (rc.roleid IN ($roleids)
      ==> AND (ctx.id='{$context->id}' OR ctx.path LIKE '{$context->path}/%'))
      $wherelocalroles
      ORDER BY ctx.depth ASC, ctx.path DESC, rc.roleid ASC ";

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                martinlanghoff Martín Langhoff
                Reporter:
                deligant Christian Deligant
                Tester:
                Nobody
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

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