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

Double escaping of OPTGROUP labels in choose_from_menu_nested()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 1.9.6
    • Libraries
    • None
    • MOODLE_19_STABLE
    • Easy

      In lib/weblib.php around line 1011, inside function choose_from_menu_nested(), there is the following:

      $output .= ' <optgroup label="'. s(format_string($section)) .'">'."\n";

      The double escaping of the $section string is causing optgroup labels to display HTML codes such as "&"

      To reproduce the issue, simply put this code in a test page:

      <?php
      require_once 'config.php';

      $options['One & two'][1] = 'One';
      $options['One & two'][2] = 'Two';
      print choose_from_menu_nested($options, 'number');
      ?>

            rwijaya Rossiani Wijaya
            francois Francois Marier (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.