ZF-10669: Numerous files contain ASCII 0x0d (CR) characters (again)

Issue Type: Coding Standards Violation Created: 2010-11-11T07:52:19.000+0000 Last Updated: 2010-12-09T20:15:03.000+0000 Status: Resolved Fix version(s): - 1.11.2 (30/Dec/10)

Reporter: Christoph Luehr (chluehr) Assignee: Marc Hodgins (mjh_ca) Tags: - Zend_Application_Resource

  • Zend_Cloud_DocumentService
  • Zend_Cloud_QueueService
  • Zend_Cloud_StorageService
  • Zend_Http_UserAgent

Related issues: - ZF-9195



These files contain CRLF endings:

Zend/Service/Amazon/SimpleDb/Page.php Zend/Cloud/QueueService/Message.php Zend/Cloud/QueueService/Exception.php Zend/Cloud/StorageService/Exception.php Zend/Cloud/StorageService/Adapter/S3.php Zend/Cloud/StorageService/Adapter/FileSystem.php Zend/Cloud/StorageService/Adapter/WindowsAzure.php Zend/Cloud/StorageService/Adapter/Nirvanix.php Zend/Cloud/OperationNotAvailableException.php Zend/Cloud/DocumentService/Query.php Zend/Cloud/DocumentService/QueryAdapter.php Zend/Cloud/DocumentService/Document.php Zend/Cloud/DocumentService/Exception.php Zend/Cloud/DocumentService/Adapter/WindowsAzure/Query.php Zend/Cloud/DocumentService/Adapter/SimpleDb.php Zend/Cloud/Exception.php Zend/Http/UserAgent/Mobile.php Zend/Application/Resource/Useragent.php

This file contains a BOM: Zend/Locale/Data/zh.xml

As these kindof errors tend to pop up each ZF release, why not add a specific test for it?

Kind regards, Chris


Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-11-11T08:12:39.000+0000

Reassigning to Matthew (I think you committed (most of) these files?). On a sidenote: maybe we can somehow automate the removing of such line endings (or at least warn the person committing)?

Posted by Christoph Luehr (chluehr) on 2010-11-11T09:04:15.000+0000

CR-LF: find . ( -name '.php' -o -name '.xml' ) -exec grep --max-count=1 --files-with-matches -P '\r\n' {} \;

Posted by Christoph Luehr (chluehr) on 2010-11-11T09:06:15.000+0000

well, like that - JIRA chewed some of my backslashes and asterisks ...

Posted by Marc Hodgins (mjh_ca) on 2010-12-09T20:00:40.000+0000

Fixed in r23483 , merged to 1.11 release branch in r23484

Also removed trailing spaces.

Posted by Marc Hodgins (mjh_ca) on 2010-12-09T20:15:03.000+0000

For future reference, this was done (from /library/ dir) with:

<pre class="literal">
# replace CRLF with LF
find . -name '*.php' -print0 | xargs -0 perl -i -p -e 's/\r//'

# remove trailing whitespace
find . -name '*.php' -print0 | xargs -0 sed --regexp-extended --in-place 's/[ ]*$//g'

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.