mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-70721 output: Remove redundant title
The format_string() function does half html escaping. It escapes < and > characters, but does not escape ". Therefore, it put us in a situation where neither {{}}, nor {{{}}} are suitable in templates. If we use {{}} for an attribute (like title or aria-label), then < and > characters will be double escaped. On the other hand, if we use {{{}}} there, a double quote character will break HTML when it is used in an attribute. Therefore, neither {{}}, nore {{{}}} are usable in html attributes. Moreover, The title attribute here was redundant because it had the same value as the link's text.
This commit is contained in:
parent
652392d932
commit
7ba7920aa8
@ -74,7 +74,6 @@ class activity_navigation implements renderable, templatable {
|
||||
$attributes = [
|
||||
'class' => 'btn btn-link',
|
||||
'id' => 'prev-activity-link',
|
||||
'title' => $linkname,
|
||||
];
|
||||
$this->prevlink = new \action_link($linkurl, $OUTPUT->larrow() . ' ' . $linkname, null, $attributes);
|
||||
}
|
||||
@ -90,7 +89,6 @@ class activity_navigation implements renderable, templatable {
|
||||
$attributes = [
|
||||
'class' => 'btn btn-link',
|
||||
'id' => 'next-activity-link',
|
||||
'title' => $linkname,
|
||||
];
|
||||
$this->nextlink = new \action_link($linkurl, $linkname . ' ' . $OUTPUT->rarrow(), null, $attributes);
|
||||
}
|
||||
|
@ -52,11 +52,11 @@
|
||||
}
|
||||
}}
|
||||
{{^disabled}}
|
||||
<a href="{{{url}}}" id="{{id}}" class="{{classes}}" {{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{{text}}}</a>
|
||||
<a href="{{{url}}}" id="{{id}}" class="{{classes}}" {{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{{text}}}</a>
|
||||
{{#hasactions}}
|
||||
{{> core/actions }}
|
||||
{{/hasactions}}
|
||||
{{/disabled}}
|
||||
{{#disabled}}
|
||||
<span class="currentlink {{classes}}" {{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{{text}}}</span>
|
||||
<span class="currentlink {{classes}}" {{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{text}}</span>
|
||||
{{/disabled}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user