Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Correctly parse empty Subject header #3571

Closed
wants to merge 1 commit into from
Closed

Correctly parse empty Subject header #3571

wants to merge 1 commit into from

Conversation

steffenweber
Copy link
Contributor

Without this fix parsing an email with an empty subject header "Subject:" (no whitespace after the colon) fails.

Notice: Undefined offset: 1 in library/Zend/Mail/Header/Subject.php on line 35

Fatal error: Uncaught exception 'Zend\Mail\Header\Exception\InvalidArgumentException' with message 'Invalid header line for Subject string' in library/Zend/Mail/Header/Subject.php:39
Stack trace:
#0 library/Zend/Mail/Headers.php(453): Zend\Mail\Header\Subject::fromString('Subject: ')
#1 library/Zend/Mail/Headers.php(288): Zend\Mail\Headers->lazyLoadHeader(10)
#2 library/Zend/Mail/Storage/Part.php(297): Zend\Mail\Headers->get('Subject')
#3 library/Zend/Mail/Storage/Part.php(372): Zend\Mail\Storage\Part->getHeader('Subject', 'string')
#4 mail-bouncer.php(14): Zend\Mail\Storage\Part->__get('Subject')

Without this fix parsing an email with an empty subject header "Subject:" fails.

Fatal error: Uncaught exception 'Zend\Mail\Header\Exception\InvalidArgumentException' with message 'Invalid header line for Subject string' in library/Zend/Mail/Header/Subject.php:39
weierophinney added a commit that referenced this pull request Jan 29, 2013
- Created test that demonstrates empty subject header is correctly
  parsed
weierophinney added a commit that referenced this pull request Jan 29, 2013
@ghost ghost assigned weierophinney Jan 29, 2013
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
- Created test that demonstrates empty subject header is correctly
  parsed
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants