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

Possible simplification of code in search/lib.php

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7, 1.8, 1.9, 1.9.13
    • Fix Version/s: 1.9.14
    • Component/s: Global search
    • Labels:
      None
    • Testing Instructions:
      Hide

      0) make sure you're using the mysqli driver in your moodle.
      1) setup global search (http://docs.moodle.org/19/en/Global_Search_set-up)
      2) run the indexing script, ensure there are no warnings when inserting document title and url into the index.

      Show
      0) make sure you're using the mysqli driver in your moodle. 1) setup global search ( http://docs.moodle.org/19/en/Global_Search_set-up ) 2) run the indexing script, ensure there are no warnings when inserting document title and url into the index.
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Pull from Repository:

      Description

      search/lib.php makes direct calls to mysql_real_escape_string and the equivalent for postgresql.

      Afaik, this should be done via a call to $db->qstr(), which would apply all the checks adodb provides for other engines (oci8, mysqli and mssql), and make the code a bit simpler.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Oct/11