projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17926a8
)
CRM-18199 CRM_Utils_File::sourceSQLFile too greedy
author
Giovanni Gargani
<giovanni@gargani.it>
Fri, 9 Sep 2016 22:36:09 +0000
(
00:36
+0200)
committer
ggargani
<giovanni@gargani.it>
Fri, 16 Sep 2016 05:57:51 +0000
(07:57 +0200)
Refactored the 2 comemnt stripping regexp in just one and fixed the
greedyness
CRM/Utils/File.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/File.php
b/CRM/Utils/File.php
index 485280bd74388dff1f7e43e6945ee069cb96606b..64528a3855456117236cd4c02e02b907708ce84a 100644
(file)
--- a/
CRM/Utils/File.php
+++ b/
CRM/Utils/File.php
@@
-324,8
+324,7
@@
class CRM_Utils_File {
// get rid of comments starting with # and --
- $string = preg_replace("/^#[^\n]*$/m", "\n", $string);
- $string = preg_replace("/^(--[^-]).*/m", "\n", $string);
+ $string = preg_replace("/^(#|--)[^\R]*$/m", "", $string);
$queries = preg_split('/;\s*$/m', $string);
foreach ($queries as $query) {