There is a Bug in `PHP 5.6` which produces segfaults when you throw an exception encoded in `ISO-8859-1` on a system with default charset `UTF-8`. Throwing a KlarnaException caused by response `faultCode !== 0` and faultString (ISO-8859-1) results in segfaults in apache child process. Example: https://github.com/klarna/php-xmlrpc/blob/v4.1/src/Klarna.php#L3661 To prevent this, you could use something like this: ``` php throw new KlarnaException( iconv('ISO-8859-1//TRANSLIT', ini_get('default_charset'), $xmlrpcresp->faultString()), $status ); ``` Tested on: - Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 - Apache/2.4.10 (Debian) - PHP Version 5.6.17-0+deb8u1 - Default Charset: UTF-8 Test: ``` php throw new Exception(iconv(ini_get('default_charset'), 'ISO-8859-1', 'ß')); ```
There is a Bug in
PHP 5.6which produces segfaults when you throw an exception encoded inISO-8859-1on a system with default charsetUTF-8.Throwing a KlarnaException caused by response
faultCode !== 0and faultString (ISO-8859-1) results in segfaults in apache child process.Example:
https://github.com/klarna/php-xmlrpc/blob/v4.1/src/Klarna.php#L3661
To prevent this, you could use something like this:
Tested on:
Test: