Changeset 3947 for trunk/tools/database
- Timestamp:
- Aug 4, 2000, 10:50:56 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/www/cvs.php3
r3946 r3947 2 2 3 3 4 $sCVSROOT = "d:\\odin32\\cvs\\cvsroot"; 4 $sCVSROOT = "d:/odin32/cvs/cvsroot"; 5 $sCVSROOT = "."; 5 6 6 7 /** … … 28 29 global $sCVSROOT; 29 30 31 $this->fOk = 0; 30 32 /* 31 33 * TODO: Security: Check that the path and filename is valid! … … 35 37 { 36 38 $this->sError = "filename is invalid"; 37 return $this->fOk = 0;39 return 1; 38 40 } 39 41 … … 41 43 * Check filesize. Minimum size is 10 bytes! 42 44 */ 43 $this->sFullname = $sCVSROOT." \\".$sFilename;45 $this->sFullname = $sCVSROOT."/".$sFilename; 44 46 $cbFile = filesize($this->sFullname); 45 47 if ($cbFile <= 10) 46 48 { 47 49 $this->sError = "too small file, " . $this->sFullname . ", ". $cbFile ."\n"; 48 return $this->fOk = 0;49 } 50 if ( $cbFile >= (2*1024*1024)) //currently max size of 2MB.50 return 1; 51 } 52 if (!$fNoDeltas && $cbFile >= (2*1024*1024)) //currently max size of 2MB. 51 53 { 52 54 $this->sError = "\ntoo large file, ". $this->sFullname .", ". $cbFile ."\n"; 53 return $this->fOk = 0;55 return 1; 54 56 } 55 57 … … 82 84 $this->sError = "\nfailed to open the file $this->sFullname\n"; 83 85 fclose($hFile); 84 return 0;86 return 1; 85 87 } 86 88 … … 108 110 { 109 111 $iLine++; 110 $sLine = fgets($hFile, 0x1000 0);112 $sLine = fgets($hFile, 0x1000); 111 113 continue; 112 114 } … … 145 147 /* Get next line and remove any EOF chars */ 146 148 $iLine++; 147 $sLine = str_replace("\x1a", "", fgets($hFile, 0x1000 0));149 $sLine = str_replace("\x1a", "", fgets($hFile, 0x1000)); 148 150 continue; 149 151 } … … 206 208 $fDesc = 1; 207 209 $sRev = ""; 210 break; 211 212 /* 213 * Stop after the first log entry. 214 */ 215 case "log": 208 216 $fStop = $fNoDeltas; 209 217 break; … … 227 235 $this->sError = "Invalid file format."; 228 236 fclose($hFile); 229 return 0;237 return 1; 230 238 } 231 239 $this->aasKeys[$sKey] = $asValue; … … 356 364 * Write it! 357 365 */ 358 echo "<table><tr><td bgcolor=\"#020286\"><pre><font size=-0 color=\"#02FEFE\">\n";366 echo "<table><tr><td bgcolor=\"#020286\"><pre><font size=-0 face=\"System VIO, System Monospaced\" color=\"#02FEFE\">\n"; 359 367 360 368 $fComment = 0; … … 636 644 else 637 645 { 638 while ($j < $cchLine && $sLine[$j] != '&' 639 && substr($sLine[$j], $i, 6) != """) 646 while ($j < $cchLine && ($sLine[$j] != '&' || substr($sLine, $j, 6) != """)) 640 647 $j += ($sLine[$j] == '\\') ? 2 : 1; 641 648 if ($j < $cchLine) … … 682 689 if ($cchWord > 0 && isset($aC_Keywords[substr($sLine, $i, $cchWord)])) 683 690 $sRet .= "<font color=\"#FF0202\">" . substr($sLine, $i, $cchWord) . "</font>"; 691 692 /* 693 * Check for number 694 */ 695 else if ($sLine[$i] >= '0' && $sLine[$i] <= '9') 696 $sRet .= "<font color=\"#FE0202\">" . substr($sLine, $i, $cchWord) . "</font>"; 684 697 685 698 /*
Note:
See TracChangeset
for help on using the changeset viewer.