Author: as Date: Tue Nov 27 10:51:18 2007 New Revision: 6824 Log: - Nicer regular expression for parsing headers.
Modified: trunk/Mail/src/parser/interfaces/part_parser.php trunk/Mail/src/parser/parts/delivery_status_parser.php trunk/Mail/src/transports/storage/storage_set.php Modified: trunk/Mail/src/parser/interfaces/part_parser.php ============================================================================== --- trunk/Mail/src/parser/interfaces/part_parser.php [iso-8859-1] (original) +++ trunk/Mail/src/parser/interfaces/part_parser.php [iso-8859-1] Tue Nov 27 10:51:18 2007 @@ -172,7 +172,7 @@ protected function parseHeader( $line, ezcMailHeadersHolder $headers ) { $matches = array(); - preg_match_all( "/^([\w-_]*):[\s]{0,1}(.*)/", $line, $matches, PREG_SET_ORDER ); + preg_match_all( "/^([\w-_]*):\s?(.*)/", $line, $matches, PREG_SET_ORDER ); if ( count( $matches ) > 0 ) { $headers[$matches[0][1]] = str_replace( "\t", " ", trim( $matches[0][2] ) ); Modified: trunk/Mail/src/parser/parts/delivery_status_parser.php ============================================================================== --- trunk/Mail/src/parser/parts/delivery_status_parser.php [iso-8859-1] (original) +++ trunk/Mail/src/parser/parts/delivery_status_parser.php [iso-8859-1] Tue Nov 27 10:51:18 2007 @@ -74,7 +74,7 @@ protected function parseHeader( $line, ezcMailHeadersHolder $headers ) { $matches = array(); - preg_match_all( "/^([\w-_]*):[\s]{0,1}(.*)/", $line, $matches, PREG_SET_ORDER ); + preg_match_all( "/^([\w-_]*):\s?(.*)/", $line, $matches, PREG_SET_ORDER ); if ( count( $matches ) > 0 ) { $this->lastParsedHeader = $matches[0][1]; Modified: trunk/Mail/src/transports/storage/storage_set.php ============================================================================== --- trunk/Mail/src/transports/storage/storage_set.php [iso-8859-1] (original) +++ trunk/Mail/src/transports/storage/storage_set.php [iso-8859-1] Tue Nov 27 10:51:18 2007 @@ -147,7 +147,7 @@ { // Temporary value in case the Message-ID cannot be extracted from $line $this->id = $this->file; - preg_match_all( "/^([\w-_]*):[\s]{0,1}(.*)/", $line, $matches, PREG_SET_ORDER ); + preg_match_all( "/^([\w-_]*):\s?(.*)/", $line, $matches, PREG_SET_ORDER ); if ( count( $matches ) > 0 ) { $this->id = trim( trim( $matches[0][2] ), '<>' ); -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components