Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ae030d
)
MDL-50128 mod_data: String needed escaping before being used in regex
author
Frederic Massart
<fred@moodle.com>
Wed, 6 May 2015 08:29:48 +0000
(16:29 +0800)
committer
Andrew Nicols
<andrew@nicols.co.uk>
Thu, 7 May 2015 03:19:47 +0000
(11:19 +0800)
mod/data/lib.php
patch
|
blob
|
blame
|
history
diff --git
a/mod/data/lib.php
b/mod/data/lib.php
index
37959a0
..
9bd39ce
100644
(file)
--- a/
mod/data/lib.php
+++ b/
mod/data/lib.php
@@
-885,7
+885,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'));