- while($entry=$d->read()) {
- // $fname = get_location () . '/sounds/' . $entry;
- if ($entry != '..' && $entry != '.' && $entry != 'CVS' && $entry != 'index.php') {
- echo '<option ';
- if ($entry == $newmail_media) {
- echo 'selected="selected" ';
+ if ($d) {
+ while($entry=$d->read()) {
+ // $fname = get_location () . '/sounds/' . $entry;
+ if ($entry != '..' && $entry != '.' && $entry != 'CVS' && $entry != 'index.php') {
+ echo '<option ';
+ if ($entry == $newmail_media) {
+ echo 'selected="selected" ';
+ }
+ echo 'value="' . sm_encode_html_special_chars($entry) . '">' .
+ sm_encode_html_special_chars($entry) . "</option>\n";