mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
parent
b8db745a61
commit
9d6e23a845
@ -90,11 +90,11 @@ class ImportSourceRestApi extends ImportSourceHook
|
||||
$headers = [];
|
||||
|
||||
$text = $this->getSetting('headers', '');
|
||||
foreach (preg_split("~\r?\n~", $text) as $header) {
|
||||
foreach (preg_split('~\r?\n~', $text, -1, PREG_SPLIT_NO_EMPTY) as $header) {
|
||||
$header = trim($header);
|
||||
$parts = preg_split('~\s*:\s*~', $header, 2);
|
||||
if (count($parts) < 2) {
|
||||
throw new InvalidPropertyException('Could not parse header: %s', $header);
|
||||
throw new InvalidPropertyException('Could not parse header: "%s"', $header);
|
||||
}
|
||||
|
||||
$headers[$parts[0]] = $parts[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user