Comments (1)
The error occurs because there is an equals-sign in the parameter value. The '==' in the value is the tail of a base64 sequence. According to VCard 4.0 Sec 3.3, '=' is a SAFE-CHAR in values and does not need to be quoted or escaped, so the value is legal input.
The better solution would be to limit the number of terms returned by \explode(..):
$param = \explode('=', $paramStr, 2);
We are only interested in the first equals in the parameter.
The parameter name is only permitted alpha, digits, and '-', so we don't have to worry about any
quoted or escaped equals-signs waiting to ambush us. If there are quoted or unquoted equals-signs in the value, we should not care. We then only have to deal with the possibility
that 2.1 VCards may have bare type parameters (no '=').
This does lead to the issue, however that the spec allows quoted or escaped semi-colons and colons, so we need to take care with that when splitting the parameter strings initially. I am taking care of that in my implementation by using preg_split(..) to filter out valid escape sequences.
from vcard-parser.
Related Issues (20)
- PHP Parse error HOT 1
- E-mail is not parsed from vCard HOT 2
- Fatal error: allowed mem size on vcard with photo HOT 3
- Wrong parsing of "adr" field
- Does not parse Apples vCard very well
- Difference between 2.1 and 3.0 versions
- vCard.php is not complete
- note field missing HOT 1
- Howto create new entry with type and sub element (eg: adr) HOT 5
- Unable to parse multiple contacts in single Vcard HOT 1
- Apple vCards provide no CATEGORIES
- Case problem with begin and end tags
- Fatal error: Uncaught Error: Xdebug has detected a possible infinite loop
- Parser chokes on AGENT HOT 1
- Patch with comments and proposed changes HOT 3
- vCard.php Parse Error HOT 3
- problematic vcard from Apple Addressbook HOT 2
- Empty vcard show as valid HOT 1
- Addresses from Apple Addressbook cannot be parsed HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vcard-parser.