cleanup input EOL to work around https://bugs.php.net/65732