MDL-37506 question code: incorrect preg_quote uses.

For preg_quote to work reliably, you must pass the delimiter you are
using for your regular expression. In many places we were failing to do
that.
This commit is contained in:
Tim Hunt
2013-01-18 11:18:54 +00:00
parent a5ec499521
commit 03cefcc91b
25 changed files with 73 additions and 73 deletions
@@ -107,7 +107,7 @@ class qtype_missing_test extends question_testcase {
$this->assertRegExp('/' .
preg_quote($qa->get_question()->questiontext, '/') . '/', $output);
$this->assertRegExp('/' .
preg_quote(get_string('missingqtypewarning', 'qtype_missingtype')) . '/', $output);
preg_quote(get_string('missingqtypewarning', 'qtype_missingtype'), '/') . '/', $output);
$this->assert(new question_contains_tag_with_attribute(
'div', 'class', 'warning missingqtypewarning'), $output);
}