diff --git a/CHANGELOG.md b/CHANGELOG.md index 041bc03..33768fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - [x] use _requires_ or dc_min in _fixdcstore_ - [x] fix unwanted translation of module name in _fixdcstore_ - [x] add modifier _first upper case_ : _\u_ in _fixphpheader_ +- [x] fix whitespace and newline for bloc content in _fixphpheader_ 0.0.1 - First pre-release \ No newline at end of file diff --git a/inc/lib.improve.action.phpheader.php b/inc/lib.improve.action.phpheader.php index beeab8d..78f6894 100644 --- a/inc/lib.improve.action.phpheader.php +++ b/inc/lib.improve.action.phpheader.php @@ -155,6 +155,8 @@ class ImproveActionPhpheader extends ImproveAction return null; } + $bloc = trim(str_replace("\r\n", "\n", $bloc)); + try { $this->bloc = preg_replace_callback( // use \u in bloc content for first_upper_case @@ -196,7 +198,7 @@ class ImproveActionPhpheader extends ImproveAction private function deleteDocBloc($content) { return preg_replace( - '/^(\<\?php[\n|\r\n]{0,1}\/\*\*.*?\s*\*\/\s*[\n|\r\n]+)/msi', + '/^(\<\?php\s*[\n|\r\n]{0,1}\s*\/\*\*.*?\s*\*\/\s*[\n|\r\n]+)/msi', "