Git Product home page Git Product logo

Comments (1)

evought avatar evought commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.