$links = [];
foreach ($urls as $url) {
+ if (empty($url)) {
+ continue;
+ }
$link = $this->buildLinkDataFromUrl($request, $url);
$data = $this->buildFormData($link, $link['linkIsNew'], $request);
$data['token'] = $this->container->sessionManager->generateToken();
$urls = [
'https://domain1.tld/url1',
'https://domain2.tld/url2',
+ ' ',
'https://domain3.tld/url3',
];
static::assertCount(3, $assignedVariables['links']);
static::assertSame($urls[0], $assignedVariables['links'][0]['link']['url']);
static::assertSame($urls[1], $assignedVariables['links'][1]['link']['url']);
- static::assertSame($urls[2], $assignedVariables['links'][2]['link']['url']);
+ static::assertSame($urls[3], $assignedVariables['links'][2]['link']['url']);
}
}