Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-5939

SQL type reports are not processed through Moodle filters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.10
    • Fix Version/s: None
    • Labels:
      None
    • Plugin Version:
      2.3.7
    • Affected Branches:
      MOODLE_27_STABLE

      Description

      Here is how to fix this issue by modifying the reports/sql/report.class.php file:

      Was:

      foreach($array_row as $ii => $cell) {
          $array_row[$ii] = str_replace('[[QUESTIONMARK]]', '?', $cell);
      }
      

      Replace with:

      foreach($array_row as $ii => $cell) {
          $cell = format_text($cell, FORMAT_HTML, array('trusted' => true,'noclean' => true, 'para' => false));
          $array_row[$ii] = str_replace('[[QUESTIONMARK]]', '?', $cell);
      }
      

      I chose to use format_text() instead of format_string() because you never know what kind of content people will include in their reports.

      Let me know if you have any questions.

      Best regards,

      Michael Milette

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: