path tag corrections
This commit is contained in:
parent
c951f7d13e
commit
a2ac9776ff
1 changed files with 4 additions and 3 deletions
|
@ -283,7 +283,7 @@ function path_to_tags(string $path): string
|
||||||
$matches = [];
|
$matches = [];
|
||||||
$tags = [];
|
$tags = [];
|
||||||
if(preg_match("/\d+ - (.+)\.([a-zA-Z0-9]+)/", basename($path), $matches)) {
|
if(preg_match("/\d+ - (.+)\.([a-zA-Z0-9]+)/", basename($path), $matches)) {
|
||||||
$tags = explode($matches[1]," ");
|
$tags = explode(" ",$matches[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = dirname($path);
|
$path = dirname($path);
|
||||||
|
@ -310,7 +310,7 @@ function path_to_tags(string $path): string
|
||||||
// So we attach the inherited category to the tag.
|
// So we attach the inherited category to the tag.
|
||||||
$tag = $category.$tag;
|
$tag = $category.$tag;
|
||||||
}
|
}
|
||||||
array_push($tags, $tag);
|
$tags[] = $tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Category inheritance only works on the immediate subfolder,
|
// 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
|
// it back to an empty string after that iteration
|
||||||
$category = $category_to_inherit;
|
$category = $category_to_inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode(" ",$tags);
|
return implode(" ",$tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue