This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
podcast_generator [2020/01/03 16:26] neil |
podcast_generator [2020/01/03 16:46] (current) neil |
||
|---|---|---|---|
| Line 44: | Line 44: | ||
| */ | */ | ||
| if(empty($_REQUEST['dirname'])) | if(empty($_REQUEST['dirname'])) | ||
| - | dir("Missing mp3 directory"); | + | die("Missing mp3 directory"); |
| $dir_name = basename($_REQUEST['dirname']); | $dir_name = basename($_REQUEST['dirname']); | ||
| + | |||
| + | if(preg_match('/[^a-z_\-0-9]/i', $dir_name)) | ||
| + | die("Invalid directory"); | ||
| if(!empty($dir_name) and is_dir($mp3_dir.$dir_name)) { | if(!empty($dir_name) and is_dir($mp3_dir.$dir_name)) { | ||
| Line 57: | Line 60: | ||
| die("Missing info.json"); | die("Missing info.json"); | ||
| - | header("Content-Type: application/rss+xml; charset=ISO-8859-1"); | + | header("Content-Type: application/rss+xml; charset=utf-8"); |
| $json = json_decode(file_get_contents($meta_file), true); | $json = json_decode(file_get_contents($meta_file), true); | ||