namespace PhpXmlRpc;
+use PhpXmlRpc\Helper\Logger;
use PhpXmlRpc\Helper\XMLParser;
/**
$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)) {
if (extension_loaded('mbstring')) {
$xmlVal = mb_convert_encoding($xmlVal, 'UTF-8', $valEncoding);
} else {
- error_log('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of xml text: ' . $valEncoding);
+ Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of xml text: ' . $valEncoding);
}
}
}
if ($xmlRpcParser->_xh['isf'] > 1) {
// test that $xmlrpc->_xh['value'] is an obj, too???
- error_log($xmlRpcParser->_xh['isf_reason']);
+ Logger::instance()->errorLog($xmlRpcParser->_xh['isf_reason']);
return false;
}