printf(_('Alternatively, you can use FTP to upload a new file at %1$s.'), forge_get_config('ftp_upload_host'));
echo '<br />';
echo _('Choose an already uploaded file:').'<br />';
- $ftp_files_arr=ls($upload_dir,true);
+ $ftp_files_arr=frs_filterfiles(ls($upload_dir,true));
echo html_build_select_box_from_arrays($ftp_files_arr,$ftp_files_arr,'ftp_filename',''); ?>
</p>
<?php } ?>
$incoming, "sftp://" . forge_get_config ('web_host') . $incoming . "/");
echo ' ' . _('This direct <tt>sftp://</tt> link only works with some browsers, such as Konqueror.') . '<br />';
echo _('Choose an already uploaded file:').'<br />';
- $manual_files_arr=ls($incoming,true);
+ $manual_files_arr=frs_filterfiles(ls($incoming,true));
echo html_build_select_box_from_arrays($manual_files_arr,$manual_files_arr,'manual_filename',''); ?>
</p>
<?php } ?>
printf(_('Alternatively, you can use FTP to upload a new file at %1$s.'), forge_get_config('ftp_upload_host'));
echo '<br />';
echo _('Choose an FTP file instead of uploading:').'<br />';
- $ftp_files_arr=ls($upload_dir,true);
+ $ftp_files_arr=frs_filterfiles(ls($upload_dir,true));
echo html_build_select_box_from_arrays($ftp_files_arr,$ftp_files_arr,'ftp_filename',''); ?>
</p>
$incoming, "sftp://" . forge_get_config ('web_host') . $incoming . "/");
echo ' ' . _('This direct <tt>sftp://</tt> link only works with some browsers, such as Konqueror.') . '<br />';
echo _('Choose an already uploaded file:').'<br />';
- $manual_files_arr=ls($incoming,true);
+ $manual_files_arr=frs_filterfiles(ls($incoming,true));
echo html_build_select_box_from_arrays($manual_files_arr,$manual_files_arr,'manual_filename',''); ?>
</p>
<?php } ?>
}
if ($filechecks) {
+ if (strlen($fname) < 3)
+ exit_error('Error',_('FRSFile Name Must Be At Least 3 Characters'));
if (!$move) {
$tmp = tempnam ('', '') ;
copy ($infile, $tmp) ;
}
}
+/* filter utils.php:&ls() output for additional constraints from FRS */
+function frs_filterfiles($in) {
+ $out = array();
+ for ($i = 0; $i < count($in); $i++) {
+ if (strlen($in[$i]) < 3)
+ continue;
+ $out[] = $in[$i];
+ }
+ return $out;
+}
+
// Local Variables:
// mode: php
// c-file-style: "bsd"