[Fixed] no input error

if activated but no chars are given, it'll cut out the whole category-string
-> added char-check
This commit is contained in:
2025-06-12 09:04:57 +02:00
gecommit door MaxBuhe01
bovenliggende 56fbb1d606
commit c868b515b2

Bestand weergeven

@ -33,10 +33,14 @@ trait articleTreeStructure
*/
public function cleanUpTitle($title) :string
{
// decode encoded characters
$title = html_entity_decode($title, ENT_QUOTES);
// remove unwanted characters, e.g. Zoll "
$charsToReplace = Registry::get(ViewConfig::class)->getCharsToReplaceInCategorTitles();
if (empty($charsToReplace)){
return $title;
}
// decode encoded characters
$title = html_entity_decode($title, ENT_QUOTES);
$title = preg_replace('/[' . $charsToReplace . ']/', '', $title);
// trim whitespace from both ends of the string
$title = trim($title);