Git Product home page Git Product logo

Comments (6)

pierre-H avatar pierre-H commented on June 10, 2024

Same problem ... :-(

from apiv3-php-library.

Lreus avatar Lreus commented on June 10, 2024

Hello everyone,

As we encountered the same bug with a 480Kb jpg attachment, it appears that the validation process in class SendSmtpEmailAttachment is the source of the error.

Indeed the statement !preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['content']) used several times in the code raises the PREG_JIT_STACKLIMIT_ERROR (code 6 returned from preg_last_error()) documented in php manual.

Disabling PCRE JIT wiht statement ini_set('pcre.jit', '0'); for debugging purpose showed that preg_match raised the PREG_RECURSION_LIMIT_ERROR (code 3) that we could pass by raising the limit with ini_set('pcre.recursion_limit', '1000000000');

A solution would be to validate attachment content with false !== base_64_decode($content, $strict = true)

from apiv3-php-library.

alexandrebrubeyonds avatar alexandrebrubeyonds commented on June 10, 2024

Up, problem still here, I can't join a pdf

from apiv3-php-library.

chris-cara avatar chris-cara commented on June 10, 2024

Up, same problem for me with a 75Ko pdf attachment.

When i tried to convert the base64 to pdf document with an online converter, the pdf is ok

from apiv3-php-library.

andreipop2005 avatar andreipop2005 commented on June 10, 2024

Is this API dead?? Nobody from Sendinblue to handle it?

from apiv3-php-library.

orinoco avatar orinoco commented on June 10, 2024

You can work around this by including the base64 content in the constructor, which doesn't run it through the regex check (which causes the PREG_JIT_STACKLIMIT_ERROR).

    $content = base64_encode(...);
    $attachment = new SendSmtpEmailAttachment(["name" => $terms->getName(), "content" => $content]);

Not sure why they would run large attachments through a regex in the first place, tbh.

from apiv3-php-library.

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.