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:
stronk7
2005-03-30 23:34:04 +00:00
parent d6bd83a6c9
commit dfde3b2069
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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
View File
@@ -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>";
}