Moodle

The 'Assign roles in course: x' button escapes html twice

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.7
  • Fix Version/s: None
  • Component/s: Libraries, Roles / Access
  • Labels:
    None
  • Database:
    MySQL
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE

Description

I found this s() function to be a problem on the button for the Assign Roles in a Course page. The course name contains an & in it and in the DB was being stored as & which is fine, except that when it is pulled out of the DB to be used in the button text "Assign Roles in Course: _____" it was being run through this function so the source comes out looks like & and you see & in the course name.

It can easily be fixed by swapping out the line in the print_single_button function to not use the s($label) and just use $label instead, but I thought that would be something that could be fixed in future releases?

Issue Links

Activity

Hide
Dan Poltawski added a comment -

Hi Erin,

The problem is not that the s() function shouldn't be used, but actually that the string is escaped twice.

Show
Dan Poltawski added a comment - Hi Erin, The problem is not that the s() function shouldn't be used, but actually that the string is escaped twice.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: