Repository navigation
Conversation
KEY and SOUND map to FlatText, so a base64 encoded key or sound in vCard 2.1 or 3.0 was read as text: getValue() returned the base64 string, and the conversion to vCard 4.0 did not give a data: URI. An ENCODING parameter of b or BASE64 now selects Property\Binary when no VALUE parameter picks the class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The class of a property comes from its
VALUEparameter, or else from its name. PHOTO and LOGO map toBinary, but KEY and SOUND map toFlatText. vCard 2.1 and 3.0 embed keys and sounds in base64 too:Such properties are read as text. As a result:
getValue()returns the base64 string, not the data;KEY:LS0tLS1CRUdJTg==, whereVCardConverterwould otherwise give adata:URI, as it does for PHOTO and LOGO.Change
In
Document::createProperty(), when noVALUEparameter picks the class, anENCODINGparameter ofborBASE64selectsProperty\Binary. An explicitVALUEstill comes first.Serialization is unchanged:
Binarywrites the value back in base64 with itsENCODINGparameter.Not covered: the nameless
BASE64parameter of vCard 2.1 (KEY;BASE64:…). The MIME-dir parser only adds nameless parameters after creating the property, so its class is already chosen.Tests
tests/VObject/Base64EncodingTest.phpcovers a vCard 3.0 KEY (value and round trip), a vCard 2.1 SOUND, the conversion to vCard 4.0, andVALUEtaking precedence. Three of its tests fail without the fix.🤖 Generated with Claude Code