Skip to content

Commit

Permalink
Fix quoted, numbered, split parameter issue 182
Browse files Browse the repository at this point in the history
  • Loading branch information
zbateson committed Nov 6, 2021
1 parent 3c92b87 commit 244b709
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Header/Consumer/ParameterConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private function getPartFor($strName, $strValue, ArrayObject $splitParts)
$matches[1],
$strValue,
$matches[2],
(empty($matches[2]) || !empty($matches[3]))
(($matches[2] === '') || !empty($matches[3]))
);
}
return $this->partFactory->newParameterPart($strName, $strValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ public function testSplitHeaderWithRfc2047()
$this->assertCount(2, $ret);
$this->assertEquals('TS Eliot', $ret[1]->getValue());
}

public function testSplitHeaderWithQuotedValueContainingDoubleApos()
{
$ret = $this->parameterConsumer->__invoke('hotdogs; condiments*0="'
. 'That\'s \'gotta\' hurt"');
$this->assertNotEmpty($ret);
$this->assertCount(2, $ret);
$this->assertEquals('That\'s \'gotta\' hurt', $ret[1]->getValue());
}

public function testSplitHeaderWithSplitRfc2047()
{
Expand Down

0 comments on commit 244b709

Please sign in to comment.