From a2ac9776ff30c0468947715a6f702f4058168704 Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Wed, 19 Jun 2019 23:26:30 -0500 Subject: [PATCH] path tag corrections --- core/util.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/util.php b/core/util.php index 3c1ef7e1..566474df 100644 --- a/core/util.php +++ b/core/util.php @@ -283,9 +283,9 @@ function path_to_tags(string $path): string $matches = []; $tags = []; if(preg_match("/\d+ - (.+)\.([a-zA-Z0-9]+)/", basename($path), $matches)) { - $tags = explode($matches[1]," "); + $tags = explode(" ",$matches[1]); } - + $path = dirname($path); $path = str_replace(";", ":", $path); $path = str_replace("__", " ", $path); @@ -310,7 +310,7 @@ function path_to_tags(string $path): string // So we attach the inherited category to the tag. $tag = $category.$tag; } - array_push($tags, $tag); + $tags[] = $tag; } } // Category inheritance only works on the immediate subfolder, @@ -318,6 +318,7 @@ function path_to_tags(string $path): string // it back to an empty string after that iteration $category = $category_to_inherit; } + return implode(" ",$tags); }