Closed aseering closed 8 years ago
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.
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.
I'm not sure if HHVM is supported? It mostly works, but I'm hitting this issue:
This appears to be due to facebook/hhvm#6440, which has a patch but the patch has some unresolved test failures. Basically, HHVM hasn't implemented any of the
convert.*
filters yet.