Skip to content

Commit

Permalink
[Merged][BugFix] Bug 5485 - problem with regular expressions with sim…
Browse files Browse the repository at this point in the history
…ple analysis
  • Loading branch information
mark-nielsen committed May 16, 2006
1 parent 4a428b5 commit 74e3524
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mod/lesson/action/continue.php
Expand Up @@ -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) ) {
Expand Down

0 comments on commit 74e3524

Please sign in to comment.