From dacb47c0ca5a8a2ffb00dfc3d226737fcf158c49 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 6 Mar 2007 02:59:25 +0000 Subject: [PATCH] MDL-8691 - Finally found the source of the error and fixed it. Add to apply s(format_string($week_summary)) on the optgroup's label. --- lib/simpletest/testweblib.php | 5 +++++ lib/weblib.php | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/simpletest/testweblib.php b/lib/simpletest/testweblib.php index 9506311406..214d23111b 100644 --- a/lib/simpletest/testweblib.php +++ b/lib/simpletest/testweblib.php @@ -28,6 +28,11 @@ class web_test extends UnitTestCase { $this->assertEqual(format_string("ANother & &&&&& Category"), "ANother & &&&&& Category"); $this->assertEqual(format_string("ANother & &&&&& Category", true), "ANother & &&&&& Category"); $this->assertEqual(format_string("Nick's Test Site & Other things", true), "Nick's Test Site & Other things"); + } + + function test_s() { + $this->assertEqual(s("This Breaks \" Strict"), "This Breaks " Strict"); + } } ?> diff --git a/lib/weblib.php b/lib/weblib.php index 589737da00..db42b43bcf 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -739,9 +739,10 @@ function choose_from_menu_nested($options,$name,$selected='',$nothing='choose',$ } if (!empty($options)) { foreach ($options as $section => $values) { - $output .= ' '."\n"; + + $output .= ' '."\n"; foreach ($values as $value => $label) { - $output .= ' '; // Plain labels $inoptgroup = true; /// everything following will be in an optgroup continue; @@ -1430,9 +1431,9 @@ function format_string ($string, $striplinks = false, $courseid=NULL ) { return $strcache[$md5]; } - // First replace all ampersands not followed html entity code + // First replace all ampersands not followed by html entity code $string = preg_replace("/\&(?![a-z0-9]{1,8};)/", "&", $string); - + if (!empty($CFG->filterall)) { $string = filter_text($string, $courseid); } -- 2.39.5