Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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
| This issue has a non-specific relationship to: | ||||
| MDL-13975 | p() and s() should not be used to print lang strings |
|
|
|
Hi Erin,
The problem is not that the s() function shouldn't be used, but actually that the string is escaped twice.