diff --git a/VERSION b/VERSION index c43e80c..b2b3d81 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ -2.8.1 +2.8.2 2.8 2 diff --git a/php/classes/Config.php b/php/classes/Config.php index cb281d8..cb880e7 100644 --- a/php/classes/Config.php +++ b/php/classes/Config.php @@ -77,7 +77,7 @@ class Config { /** * The system's version. */ - const VERSION = 'v2.8.1'; + const VERSION = 'v2.8.2'; /** * The real domain which should be used. diff --git a/php/classes/Inner.php b/php/classes/Inner.php index 1ec478e..b45d0d3 100644 --- a/php/classes/Inner.php +++ b/php/classes/Inner.php @@ -76,14 +76,14 @@ public function radioForm() : void { $radios[] = array( "ID" => $id, "COUNT" => $count, - "NAME" => $radio['name'], + "NAME" => htmlspecialchars($radio['name'], encoding: 'UTF-8'), "URL" => $radio['url'], "PROXY_YES" => $radio['proxy'] ? 'checked="checked"' : '', "PROXY_NO" => !$radio['proxy'] ? 'checked="checked"' : '', "TYPE_RADIO" => $radio['type'] != 'nc' ? 'checked="checked"' : '', "TYPE_NC" => $radio['type'] == 'nc' ? 'checked="checked"' : '', "LOGO" => $radio['logo'], - "DESC" => $radio['desc'], + "DESC" => htmlspecialchars($radio['desc'], encoding: 'UTF-8'), "CAT_OPTIONS" => array_reduce( $categories, fn($c, $i) => $c.'', @@ -108,7 +108,7 @@ public function podcastForm() : void { $podcasts[] = array( "ID" => $id, "COUNT" => $count, - "NAME" => $pod['name'], + "NAME" => htmlspecialchars($pod['name'], encoding: 'UTF-8'), "URL" => $pod['url'], "TYPE_RSS" => $pod['type'] == 'rss' ? 'checked="checked"' : '', "TYPE_NC" => $pod['type'] == 'nc' ? 'checked="checked"' : '', @@ -142,8 +142,15 @@ public static function filterURL(string $url) : string { } public static function filterName(string $name): string{ - $name = str_replace( ['ä','ü','ß','ö','Ä','Ü','Ö'], ['ae','ue','ss','oe','Ae','Ue','Oe'], $name); - $name = substr( preg_replace( '/[^0-9A-Za-z \.\-\_\,\&\;\/\(\)]/', '', $name ), 0, 200 ); + // $name = str_replace( ['ä','ü','ß','ö','Ä','Ü','Ö'], ['ae','ue','ss','oe','Ae','Ue','Oe'], $name); + $name = substr( preg_replace( + '/[^ -\x{2122}]/u', + // pattern inspired from + // https://stackoverflow.com/a/43106144 by mickmackusa + // CC BY-SA, https://creativecommons.org/licenses/by-sa/3.0/ + '', $name + ), 0, 200 ); + return empty($name) ? 'empty' : $name; }