diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2015-05-29 16:52:05 +0100 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2015-05-29 16:52:05 +0100 |
commit | 3dfe7d64760baa568018c1d6d311c26d1a2da098 (patch) | |
tree | 60bdca1cd70a14b4ec8fec689c2b9771683ff70a /inc/io.php | |
parent | 4b8290f563ad5ac84dd92fb8ca97ba5970c472b3 (diff) | |
download | rpg-3dfe7d64760baa568018c1d6d311c26d1a2da098.tar.gz rpg-3dfe7d64760baa568018c1d6d311c26d1a2da098.tar.bz2 |
add anchors when constructing pattern from a non-regex oldline
Diffstat (limited to 'inc/io.php')
-rw-r--r-- | inc/io.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/io.php b/inc/io.php index 51ca2ea14..c559feb17 100644 --- a/inc/io.php +++ b/inc/io.php @@ -312,7 +312,7 @@ function io_replaceInFile($file, $oldline, $newline, $regex=false, $maxlines=0) } // make non-regexes into regexes - $pattern = $regex ? $oldline : '/'.preg_quote($oldline,'/').'/'; + $pattern = $regex ? $oldline : '/^'.preg_quote($oldline,'/').'$/'; $replace = $regex ? $newline : addcslashes($newline, '\$'); // remove matching lines |