"Both DOS and UNIX style line endings" in heredoc/newdoc blocks – false positive
-
WARNING: Both DOS and UNIX style line endings were found in the file options.php. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.
ThemeCheck displays this error for PHP files which use heredoc/newdoc. It’s a bug of the ThemeCheck. The end of lines in those files are correct.
Details:
File main.php, line 23:
$php[$filename] = php_strip_whitespace( $filename );
php_strip_whitespace() removes white spaces from the whole file, but from obvious reasons it can’t do that for heredoc/newdoc blocks. But strangely, it changes EOL of the last line of the block to UNIX, and leaves all other unchanged. So if a file had originally Windows EOLs, the result is en error in the ThemeCheck report, but the tested code is totally fine, and the error is caused by the plugin’s bug. I can present an example file to test if you need one.
- The topic ‘"Both DOS and UNIX style line endings" in heredoc/newdoc blocks – false positive’ is closed to new replies.