Skip to content

Commit 42f0c93

Browse files
author
Till Brehm
committed
Fixed: FS#3888 - APS installer: String could not be parsed as XML
1 parent d94b1e2 commit 42f0c93

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

interface/lib/classes/aps_crawler.inc.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ private function fetchFiles($input)
189189
curl_setopt($conn[$i], CURLOPT_TIMEOUT, 0);
190190
curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1);
191191
curl_setopt($conn[$i], CURLOPT_FOLLOWLOCATION, 1);
192+
curl_setopt($conn[$i], CURLOPT_SSL_VERIFYHOST, 1);
193+
curl_setopt($conn[$i], CURLOPT_SSL_VERIFYPEER, false);
192194

193195
curl_multi_add_handle($mh, $conn[$i]);
194196
}
@@ -283,6 +285,7 @@ public function startCrawler()
283285
$apps_count = substr_count($apps[$j], '<opensearch:totalResults>0</opensearch:totalResults>');
284286
if($apps_count == 0) // obviously this vendor provides one or more apps
285287
{
288+
try {
286289
// Rename namespaces and register them
287290
$xml = str_replace("xmlns=", "ns=", $apps[$j]);
288291
$sxe = new SimpleXMLElement($xml);
@@ -456,9 +459,15 @@ public function startCrawler()
456459

457460
unset($sxe);
458461
$apps_in_repo++;
462+
} catch (Exception $e) {
463+
// We dont want the crawler to fail on xml parse errors
464+
$app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_WARN);
465+
//echo 'Caught exception: ', $e->getMessage(), "\n";
466+
}
459467
}
460468
}
461469
//var_dump($apps);
470+
//echo print_r($apps_to_dl).'<br>-------------------<br>';
462471

463472
// For memory reasons, unset the current vendor and his apps
464473
unset($apps);

server/lib/classes/aps_installer.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ private function fetchFiles($input)
554554
curl_setopt($conn[$i], CURLOPT_TIMEOUT, 0);
555555
curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1);
556556
curl_setopt($conn[$i], CURLOPT_FOLLOWLOCATION, 1);
557+
curl_setopt($conn[$i], CURLOPT_SSL_VERIFYPEER, 0);
557558

558559
curl_multi_add_handle($mh, $conn[$i]);
559560
}
@@ -696,6 +697,7 @@ public function installHandler($instanceid, $type)
696697
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
697698
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
698699
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
700+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
699701
if(curl_exec($ch) === false) $app->log(curl_error($ch), 1);
700702
fclose($fh);
701703
curl_close($ch);

0 commit comments

Comments
 (0)