Opened 17 years ago
Last modified 16 years ago
#415 closed Defect
php errors in show_log.php — at Initial Version
Reported by: | mweltin | Owned by: | Rytis |
---|---|---|---|
Priority: | Minor | Milestone: | Undetermined |
Component: | Web - Project | Version: | |
Keywords: | showlog php patch | Cc: |
Description
Some php.ini files will cause the following errors to appear when viewing logs from in $PROJECT/html/ops/show_log.php
Notice: Undefined index: f in /home/mweltin/projects/tsp/html/ops/show_log.php on line 11
Notice: Undefined index: s in /home/mweltin/projects/tsp/html/ops/show_log.php on line 12
Notice: Undefined index: l in /home/mweltin/projects/tsp/html/ops/show_log.php on line 13
Notice: Undefined variable: lines in /home/mweltin/projects/tsp/html/ops/show_log.php on line 38
By first testing for the variable with php's isset function the errors on lines 11-13 can be avoided. E.g.
if( isset($_GET["f"]) ){
$f = $_GET["f"];
} else {
$f = "";
} if( isset($_GET["s"]) ){
$s = $_GET["s"];
} else {
$s = "";
} if( isset($_GET["l"]) ){
$l = (int)$_GET["l"];
} else {
$l = 0;
}
Adding that code pushes the error from line 38 to 54, but I'm not sure what $lines is needed for. My perl is not so good, and I was not sure what the grep_logs script would use that parameter for.
-Markus