Merge
This commit is contained in:
@@ -375,12 +375,12 @@ QUERY
|
||||
|
||||
if($externalId = (int)$item['data']->external_id) {
|
||||
try {
|
||||
$externalSource = json_decode(file_get_contents($url = $this->EXTERNAL_NEWS_API . 'news?source=api&externalid=' . (int)$externalId));
|
||||
$externalSource = json_decode(file_get_contents($url = $this->EXTERNAL_NEWS_API . 'article/' . (int)$externalId));
|
||||
if($externalSource) {
|
||||
$data['version'] = 2;
|
||||
$data['source'] = $externalSource->news;
|
||||
$data['source'] = $externalSource->article;
|
||||
}
|
||||
} catch(\Exception $ex) { $data['error'] = array('source' => $url, 'exception' => $ex); }
|
||||
} catch(\Exception $ex) { $data['error'] = array('source' => $url, 'exception' => $ex->getMessage()); }
|
||||
}
|
||||
|
||||
return response()->json($data);
|
||||
|
||||
@@ -51,7 +51,9 @@ class Model {
|
||||
}
|
||||
|
||||
// Vervang alles dat niet een woord-karakter is (letter, cijfer), een streepje of spatie
|
||||
if(strlen($text) > 3) {
|
||||
$text = preg_replace('/[^\w_\-\s]/', '', $text);
|
||||
}
|
||||
|
||||
// Reeksen van één of meer spaties / streepjes vervangen door een enkel streepje
|
||||
$text = preg_replace('/[\-\s]+/', '-', $text);
|
||||
|
||||
Reference in New Issue
Block a user