Coder Social home page Coder Social logo

Comments (2)

mailbee avatar mailbee commented on May 26, 2024 1

Thank you, Adam. You're right, the patch indeed looks like a hack so that adding it into the regular version does not seem the right thing to do but we'll reference this thread for those experiencing the same issue and they will be able to fix it for the time being. Finally, I hope HHVM devs will fix the original issue and the whole thing will be no longer important.

from webmail-lite.

aseering avatar aseering commented on May 26, 2024

I was able to work around this issue by adding the following to the top of libraries/MailSo/Base/StreamWrappers/Binary.php (based on the patch at facebook/hhvm#6440 -- review patch (reviews.facebook.net)):

class ConvertFilter extends \php_user_filter {
  private $filterFunction;

  public function onCreate() {
    /* strip out prefix "convert." */
    $filterName = substr($this->filtername, 8);
    switch ($filterName) {
      case 'base64-encode':
      case 'base64-decode':
      case 'quoted-printable-encode':
      case 'quoted-printable-encode':
        $this->filterFunction = str_replace('-', '_', $filterName);
        break;
      default:
        return false;
         break;
    }
    return true;
  }

  public function filter($in, $out, &$consumed, $closing) {
    while ($bucket = stream_bucket_make_writeable($in)) {
      stream_bucket_append(
        $out,
        stream_bucket_new($this->stream,
                          call_user_func($this->filterFunction,
                                         $bucket->data)
                          )
      );
    }
    return \PSFS_PASS_ON;
  }
}

stream_filter_register('convert.*', 'MailSo\Base\StreamWrappers\ConvertFilter');

This feels like a total hack to me so I'm reluctant to put up a Pull Request with it, but I can if it'd be useful.

from webmail-lite.

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.