alt tags in radio buttons were breaking display it they contain
lang tags. Now they are filtered against strip_tags() and processed by format_text(). In vertical display, format_text() was using format_text (FORMAT_PLAIN), not sure why and it was breaking multilang support, replacing all <> to their htmlentities().
This commit is contained in:
+1
-1
@@ -193,7 +193,7 @@ function choice_get_choice($choiceid) {
|
||||
if ($choice = get_record("choice", "id", $choiceid)) {
|
||||
if ($options = get_records("choice_options", "choiceid", $choiceid, "id")) {
|
||||
foreach ($options as $option) {
|
||||
$choice->option[$option->id] = $option->text;
|
||||
$choice->option[$option->id] = $option->text;
|
||||
}
|
||||
return $choice;
|
||||
}
|
||||
|
||||
+3
-3
@@ -118,7 +118,7 @@
|
||||
foreach ($choice->option as $optionid => $text) {
|
||||
if ($text) {
|
||||
echo "<td align=\"center\">";
|
||||
echo "<input type=\"radio\" name=\"answer\" value=\"".$optionid."\" ".$answerchecked[$optionid]." alt=\"$text\" />";
|
||||
echo "<input type=\"radio\" name=\"answer\" value=\"".$optionid."\" ".$answerchecked[$optionid]." alt=\"".strip_tags(format_text($text))."\" />";
|
||||
echo format_text($text);
|
||||
echo "</td>";
|
||||
}
|
||||
@@ -132,8 +132,8 @@
|
||||
foreach ($choice->option as $optionid => $text) {
|
||||
if ($text) {
|
||||
echo "<tr><td align=\"left\">";
|
||||
echo "<input type=\"radio\" name=\"answer\" value=\"".$optionid."\" ".$answerchecked[$optionid]." alt=\"$text\" />".
|
||||
format_text($text, FORMAT_PLAIN);
|
||||
echo "<input type=\"radio\" name=\"answer\" value=\"".$optionid."\" ".$answerchecked[$optionid]." alt=\"".strip_tags(format_text($text))."\" />".
|
||||
format_text($text);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user