Skip to content

Commit 6481665

Browse files
committed
Properly trims name & slug when determined from path.
1 parent d7bb00b commit 6481665

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Objects/CreativeCloudHelper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function getBaseVersions($slug)
233233
}
234234

235235
/**
236-
* Returns the uninstall arguments as an array, using the given slug.
236+
* Returns the uninstallation arguments as an array, using the given slug.
237237
*
238238
* @param string $slug
239239
*
@@ -404,7 +404,10 @@ protected function getNameYearFromPath($path)
404404
{
405405
if (preg_match('#/Adobe (?<name>[a-zA-Z\s]+)\s?(?<year>[1-9][0-9]+)?/#', $path, $m))
406406
{
407-
return ['name' => $m['name'] ?? null, 'year' => $m['year'] ?? null];
407+
$name = isset($m['name']) ? trim($m['name']) : null;
408+
$year = isset($m['year']) ? trim($m['year']) : null;
409+
410+
return ['name' => $name, 'year' => $year];
408411
}
409412

410413
return [];

0 commit comments

Comments
 (0)