mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Add LIBXML_NONET to simplexml_load_string
This commit is contained in:
parent
0bf1db2fd4
commit
166d3b08d6
|
|
@ -232,7 +232,7 @@ class PrestaShopWebservice
|
|||
if ($response != '') {
|
||||
libxml_clear_errors();
|
||||
libxml_use_internal_errors(true);
|
||||
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
if (libxml_get_errors()) {
|
||||
$msg = var_export(libxml_get_errors(), true);
|
||||
libxml_clear_errors();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ if ($action == 'getlastversion') {
|
|||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
if (function_exists('simplexml_load_string')) {
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') {
|
|||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||
$xmlfile = $xmlarray['content'];
|
||||
//print "xmlfilestart".$xmlfile."xmlfileend";
|
||||
$xml = simplexml_load_string($xmlfile);
|
||||
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||
setEventMessages($errormsg, null, 'errors');
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ $version = '0.0';
|
|||
if ($action == 'getlastversion') {
|
||||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1683,7 +1683,7 @@ class Setup extends DolibarrApi
|
|||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||
$xmlfile = $xmlarray['content'];
|
||||
//print "xmlfilestart".$xmlfile."endxmlfile";
|
||||
$xml = simplexml_load_string($xmlfile);
|
||||
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||
throw new RestException(500, $errormsg);
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ class RssParser
|
|||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
||||
//print 'xx'.LIBXML_NOCDATA;
|
||||
libxml_use_internal_errors(false);
|
||||
$rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
$rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA|LIBXML_NOCDATA);
|
||||
} else {
|
||||
if (!function_exists('xml_parser_create')) {
|
||||
$this->error = 'Function xml_parser_create are not supported by your PHP';
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
|
|||
$resgetcommitstrip = getURLContent("https://www.commitstrip.com/en/feed/");
|
||||
}
|
||||
if ($resgetcommitstrip && $resgetcommitstrip['http_code'] == '200') {
|
||||
$xml = simplexml_load_string($resgetcommitstrip['content']);
|
||||
$xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
$little = $xml->channel->item[0]->children('content', true);
|
||||
print preg_replace('/width="650" height="658"/', '', $little->encoded);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user