Skip to content

Commit

Permalink
Escape tag search string
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Nov 20, 2020
1 parent f6592aa commit 8a13076
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion file.php
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ public function get_line_number(local_moodlecheck_file $file, $substring = null)
if ($substring === null) {
return $line0;
} else {
$chunks = preg_split('!' . $substring . '!', $this->originaltoken[1]);
$chunks = preg_split('!' . preg_quote($substring, '!') . '!', $this->originaltoken[1]);
if (count($chunks) > 1) {
$lines = preg_split('/\n/', $chunks[0]);
return $line0 + count($lines) - 1;
Expand Down

0 comments on commit 8a13076

Please sign in to comment.