Giter VIP home page Giter VIP logo

Comments (4)

fangel avatar fangel commented on August 24, 2024

This is most likely due to trim()'ing the lines down before concatenating multi-lines.

from sg-icalendar.

sanddevil avatar sanddevil commented on August 24, 2024

the bug is here:
protected static function UnfoldLines($content) {
$data = array();
$content = explode("\n", $content);
for( $i=0; $i < count($content); $i++) {
$line = rtrim($content[$i]); // <<---- BUG HERE

BUT I suspect that removing the right trim may cause side effects, particularly with respect to badly formed .ics files which don't wrap at character 76. What do you think?

from sg-icalendar.

cpfair avatar cpfair commented on August 24, 2024

Replace the explode(...) line with $content=preg_split('/\r?\n/',$content); and it's problem solved.

from sg-icalendar.

SleepyBrett avatar SleepyBrett commented on August 24, 2024

cpfair's suggestion did not actually fix it for me, I went with sanddevil and removed the offset of 1 from the $line concatenation. I haven't noticed any side effects yet.

from sg-icalendar.

Related Issues (11)

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.