From: gbateson Date: Fri, 11 May 2007 05:28:28 +0000 (+0000) Subject: when inserting 'Give Up' button, if site encoding is not iso-8859-1, then set page... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=34caf003e055c83a93c82909ca17d1bd9067e8af;p=moodle.git when inserting 'Give Up' button, if site encoding is not iso-8859-1, then set page encoding to get_string('thischarset') --- diff --git a/mod/hotpot/view.php b/mod/hotpot/view.php index 5f42d9c8a2..6a08acc69b 100644 --- a/mod/hotpot/view.php +++ b/mod/hotpot/view.php @@ -441,9 +441,22 @@ break; } // end switch $framename break; + case HOTPOT_NAVIGATION_GIVEUP: + // replace charset , if necessary + // HotPots are plain ascii (iso-8859-1) with unicode chars encoded as HTML entities + $charset = get_string("thischarset"); + if ($charset == 'iso-8859-1') { + // do nothing + } else { + $hp->html = preg_replace( + '|]*charset=iso-8859-1[^>]*>|is', + '', + $hp->html + ); + } + // no break (continue to print html to browser) default: // HOTPOT_NAVIGATION_BUTTONS - // HOTPOT_NAVIGATION_GIVEUP // HOTPOT_NAVIGATION_NONE if (!empty($available_msg)) { $hp->insert_message('', $available_msg);