upload dir validation

This commit is contained in:
Marc Delisle
2002-08-23 12:20:07 +00:00
parent 11b4950345
commit 1298a12613
91 changed files with 118 additions and 20 deletions

View File

@@ -108,26 +108,34 @@ echo "\n";
// web-server upload directory
// (TODO: display the charset selection, even if is_upload == FALSE)
if ($cfg['UploadDir'] != '' && $handle = @opendir($cfg['UploadDir'])) {
$is_first = 0;
while ($file = @readdir($handle)) {
if (is_file($cfg['UploadDir'] . $file) && substr($file, -4) == '.sql') {
if ($is_first == 0) {
echo "\n";
echo ' <i>' . $strOr . '</i> ' . $strWebServerUploadDirectory . '&nbsp;:<br />' . "\n";
echo ' <div style="margin-bottom: 5px">' . "\n";
echo ' <select size="1" name="sql_localfile">' . "\n";
echo ' <option value="" selected></option>' . "\n";
} // end if (is_first)
echo ' <option value="' . htmlspecialchars($file) . '">' . htmlspecialchars($file) . '</option>' . "\n";
$is_first++;
} // end if (is_file)
} // end while
if ($is_first > 0) {
echo ' </select>' . "\n"
. ' </div>' . "\n\n";
} // end if (isfirst > 0)
@closedir($handle);
if ($cfg['UploadDir'] != '') {
if ($handle = @opendir($cfg['UploadDir'])) {
$is_first = 0;
while ($file = @readdir($handle)) {
if (is_file($cfg['UploadDir'] . $file) && substr($file, -4) == '.sql') {
if ($is_first == 0) {
echo "\n";
echo ' <i>' . $strOr . '</i> ' . $strWebServerUploadDirectory . '&nbsp;:<br />' . "\n";
echo ' <div style="margin-bottom: 5px">' . "\n";
echo ' <select size="1" name="sql_localfile">' . "\n";
echo ' <option value="" selected></option>' . "\n";
} // end if (is_first)
echo ' <option value="' . htmlspecialchars($file) . '">' . htmlspecialchars($file) . '</option>' . "\n";
$is_first++;
} // end if (is_file)
} // end while
if ($is_first > 0) {
echo ' </select>' . "\n"
. ' </div>' . "\n\n";
} // end if (isfirst > 0)
@closedir($handle);
}
else {
echo ' <div style="margin-bottom: 5px">' . "\n";
echo ' <font color="red">' . $strError . '</font><br />' . "\n";
echo ' ' . $strWebServerUploadDirectoryError . "\n";
echo ' </div>' . "\n";
}
} // end if (web-server upload directory)
// Bookmark Support