@@ -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 );
0 commit comments