mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Trim group names on import
This commit is contained in:
@@ -394,7 +394,7 @@ class NzbImportService
|
||||
// Get the group names, group_id, check if it's blacklisted.
|
||||
$groupArr = [];
|
||||
foreach ($file->groups->group as $group) {
|
||||
$group = (string) $group;
|
||||
$group = $this->normalizeGroupName($group);
|
||||
|
||||
// If group_id is -1 try to get a group_id.
|
||||
if ($groupID === -1) {
|
||||
@@ -641,6 +641,11 @@ class NzbImportService
|
||||
return NzbImportStatus::Inserted;
|
||||
}
|
||||
|
||||
protected function normalizeGroupName(\SimpleXMLElement|string $group): string
|
||||
{
|
||||
return trim((string) $group);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all groups in the DB.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user