upload dir validation
This commit is contained in:
@@ -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 . ' :<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 . ' :<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
|
||||
|
Reference in New Issue
Block a user