From 87b7a456ee4a7c734384e7621a60b860c007fe7c Mon Sep 17 00:00:00 2001 From: gggeek Date: Mon, 29 Jul 2019 14:41:57 +0000 Subject: [PATCH] comments --- src/Encoder.php | 7 +++++-- src/Server.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Encoder.php b/src/Encoder.php index 1850ff4..f2bc88f 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 8c53349..406f056 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'))) -- 2.45.2