- string sanitizing does not remove mid-line spaces

This commit is contained in:
Wiesner András 2025-10-12 11:36:30 +02:00
parent 4a2079cf10
commit 04926e4ba6

View File

@ -2,7 +2,7 @@
function explode_list(string $str) : array { function explode_list(string $str) : array {
if (($str = trim($str, " \n\r\t\v\0,")) !== "") { if (($str = trim($str, " \n\r\t\v\0,")) !== "") {
return array_map(fn($a) => trim($a), explode(",", str_replace(" ", "", $str))); return array_map(fn($a) => trim($a), explode(",", trim($str)));
} else { } else {
return []; return [];
} }