File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,9 @@ function php_strip_whitespace(string $file): string
35
35
if (preg_match ('!^(//|#[^\[]).*$! ' , $ line )) {
36
36
return null ;
37
37
}
38
- // Prevent processing non-comment lines (eg: containing php:// or http:// uris)
39
- // to be mistakenly treated as such
40
- return preg_replace ('!\s(//|#[^\[]).*$! ' , '' , $ line );
41
- // Not working: breaks phpcc self-compiling
42
- //return preg_replace('!([^:])' . '(//|#[^\[])' . '.*$!', '$1', $line);
38
+ // Prevent processing non-comment lines to be mistakenly treated as such
39
+ // eg: context uris containing "php://" or "http://", or this regexp
40
+ return preg_replace ('!([^:(])(//|#[^\[]).*$! ' , '$1 ' , $ line );
43
41
}, $ lines );
44
42
45
43
// Second pass: multi-line comments
You can’t perform that action at this time.
0 commit comments