--- docman.php 2002/07/29 14:17:05 1.32 +++ docman.php 2003/04/09 15:55:15 1.34 @@ -81,7 +81,9 @@ // location of html files $html = $gblIncDir."/html"; - LoadLanguage($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]); + if (isset($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"])) { + LoadLanguage($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]); + } // for security and configuration $realm=$HTTP_SERVER_VARS["HTTP_HOST"]; @@ -147,8 +149,8 @@ } include("$html/footer.html"); - global $debug; - if ($debug) print $debug; +# global $debug; +# if ($debug) print $debug; } // end function EndHTML ////////////////////////////////////////////////////////////////// @@ -707,6 +709,8 @@ $note_html=$dirNote[$key]; } + $dir_html = isBlank($dir,"directory"); + include("$html/Navigate-dirEntry.html"); } // iterate over dirs @@ -782,9 +786,9 @@ $file_url_html.="\" TITLE=\"View file\">" ; if (substr($file,0,5) != ".del/") { - $file_url_html .= $file . "" . $a ; + $file_url_html .= isBlank($file) . "" . $a ; } else { - $file_url_html .= substr($file,5,strlen($file)-5) . " deleted"; + $file_url_html .= isBlank(substr($file,5,strlen($file)-5)) . " deleted"; } if (check_perm($relDir.$file,$gblPermNote)) { @@ -1539,6 +1543,14 @@ } ////////////////////////////////////////////////////////////////// + +function isBlank($file,$what = "filename") { + if (trim($file) == "") return "whitespace $what"; + if ($file == "") return "no $what"; + return $file; +} + +////////////////////////////////////////////////////////////////// // MAIN PROGRAM $gblFilePerms = 0640 ; // default for new files @@ -1701,7 +1713,7 @@ $source = $FN_name ; if (! file_exists($source)) { - Error("You must select file with browse to upload it!"); + Error("You must select file with browse to upload it!","If file is too big, you might need to modify php configuration options post_max_size and upload_max_filesize",1); } if (HTTP_POST_VAR("FILENAME")) check_filename($FILENAME);