From 74e3524216d72b905c567a5ac4b18b7f7a3cd753 Mon Sep 17 00:00:00 2001 From: mark-nielsen Date: Tue, 16 May 2006 03:06:28 +0000 Subject: [PATCH] [Merged][BugFix] Bug 5485 - problem with regular expressions with simple analysis --- mod/lesson/action/continue.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mod/lesson/action/continue.php b/mod/lesson/action/continue.php index 261de15984..cd7c3a1379 100644 --- a/mod/lesson/action/continue.php +++ b/mod/lesson/action/continue.php @@ -156,10 +156,10 @@ $expectedanswer = substr($expectedanswer,0,strlen($expectedanswer) - 2); $ignorecase = 'i'; } - } - // prevent the potential apostrophe problem! - if (preg_match_all("/'/",$expectedanswer, $matches)) { - $expectedanswer = ereg_replace("'", "\\\'", $expectedanswer); + } else { + $expectedanswer = str_replace('*', '#####', $expectedanswer); + $expectedanswer = preg_quote($expectedanswer, '/'); + $expectedanswer = str_replace('#####', '.*', $expectedanswer); } // see if user typed in any of the correct answers if (lesson_iscorrect($pageid, $answer->jumpto) or ($lesson->custom && $answer->score > 0) ) { -- 2.39.5