MDL-50128 mod_data: String needed escaping before being used in regex
This commit is contained in:
committed by
Andrew Nicols
parent
d186a97e10
commit
c3bec9f51e
+1
-1
@@ -875,7 +875,7 @@ function data_tags_check($dataid, $template) {
|
||||
// then we generate strings to replace
|
||||
$tagsok = true; // let's be optimistic
|
||||
foreach ($fields as $field){
|
||||
$pattern="/\[\[".$field->name."\]\]/i";
|
||||
$pattern="/\[\[" . preg_quote($field->name, '/') . "\]\]/i";
|
||||
if (preg_match_all($pattern, $template, $dummy)>1){
|
||||
$tagsok = false;
|
||||
echo $OUTPUT->notification('[['.$field->name.']] - '.get_string('multipletags','data'));
|
||||
|
||||
Reference in New Issue
Block a user