From: gggeek Date: Mon, 29 Jul 2019 14:41:57 +0000 (+0000) Subject: comments X-Git-Tag: 4.4.2~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=87b7a456ee4a7c734384e7621a60b860c007fe7c;p=plcapi.git comments --- diff --git a/src/Encoder.php b/src/Encoder.php index 1850ff46..f2bc88fe 100644 --- a/src/Encoder.php +++ b/src/Encoder.php @@ -236,8 +236,11 @@ class Encoder $valEncoding = XMLParser::guessEncoding('', $xmlVal); if ($valEncoding != '') { - // Since parsing will fail if charset is not specified in the xml prologue, - // the encoding is not UTF8 and there are non-ascii chars in the text, we try to work round that... + // Since parsing will fail if + // - charset is not specified in the xml prologue, + // - the encoding is not UTF8 and + // - there are non-ascii chars in the text, + // we try to work round that... // The following code might be better for mb_string enabled installs, but makes the lib about 200% slower... //if (!is_valid_charset($valEncoding, array('UTF-8')) if (!in_array($valEncoding, array('UTF-8', 'US-ASCII')) && !XMLParser::hasEncoding($xmlVal)) { diff --git a/src/Server.php b/src/Server.php index 8c533499..406f0569 100644 --- a/src/Server.php +++ b/src/Server.php @@ -474,8 +474,11 @@ class Server // decompose incoming XML into request structure if ($reqEncoding != '') { - // Since parsing will fail if charset is not specified in the xml prologue, - // the encoding is not UTF8 and there are non-ascii chars in the text, we try to work round that... + // Since parsing will fail if + // - charset is not specified in the xml prologue, + // - the encoding is not UTF8 and + // - there are non-ascii chars in the text, + // we try to work round that... // The following code might be better for mb_string enabled installs, but // makes the lib about 200% slower... //if (!is_valid_charset($reqEncoding, array('UTF-8')))