You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parser incorrectly treats extended header attributes as main attributes.
For example, in the header attribute x-keepsent: XXXX:XXXX-XXXX:XXXX; type=4; name=$KeepSent, the name attribute is mistakenly treated as a main attribute in the method \Webklex\PHPIMAP\Header::extractHeaderExtensions.
This behavior is problematic because it causes the name attribute to be recognized as a main attribute rather than an extension attribute. Consequently, the method \Webklex\PHPIMAP\Part::isAttachment mistakenly identifies the content as an attachment.
The issue lies in the header parser’s design.
Parsed headers’ values are stored in the attributes array, the key being header name (i.e. x-keepsent) and values being an object of class Attribute.
However when parsing extensions, i.e. type=4; name=$KeepSent, this convention is broken. The attributes array is populated with keys type and name as if they were actual header attributes. The extensions should be somehow attached to the existing object, representing the header being extended.
Considering our example x-keepsent: XXXX:XXXX-XXXX:XXXX; type=4; name=$KeepSent:
Expected behavior
The parser incorrectly treats extended header attributes as main attributes.
For example, in the header attribute
x-keepsent: XXXX:XXXX-XXXX:XXXX; type=4; name=$KeepSent
, thename
attribute is mistakenly treated as a main attribute in the method\Webklex\PHPIMAP\Header::extractHeaderExtensions
.This behavior is problematic because it causes the name attribute to be recognized as a main attribute rather than an extension attribute. Consequently, the method
\Webklex\PHPIMAP\Part::isAttachment
mistakenly identifies the content as an attachment.The issue lies in the header parser’s design.
Parsed headers’ values are stored in the
attributes
array, the key being header name (i.e.x-keepsent
) and values being an object of classAttribute
.However when parsing
extensions
, i.e.type=4; name=$KeepSent
, this convention is broken. Theattributes
array is populated with keystype
andname
as if they were actual header attributes. Theextensions
should be somehow attached to the existing object, representing the header being extended.Considering our example
x-keepsent: XXXX:XXXX-XXXX:XXXX; type=4; name=$KeepSent
:Expected behavior
Actual Results
The text was updated successfully, but these errors were encountered: