mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-24 20:38:36 +00:00
Skip parsing lists if null, and trim trailing space
This commit is contained in:
parent
cf2b246bc7
commit
6732e5efcc
@ -115,8 +115,11 @@ class ModrinthBridge extends BridgeAbstract
|
||||
}
|
||||
|
||||
// Converts lists like `foo, bar, baz` to `["foo", "bar", "baz"]`
|
||||
protected function parseInputList($input): ?string
|
||||
protected function parseInputList($input): ?string
|
||||
{
|
||||
if (empty($input)) {
|
||||
return null;
|
||||
}
|
||||
$items = array_filter(array_map('trim', explode(',', $input)));
|
||||
return $items ? json_encode($items) : null; // return nothing if string is empty
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user