Opened 18 years ago
Last modified 16 years ago
#415 closed Defect
php errors in show_log.php — at Version 1
| Reported by: | mweltin | Owned by: | davea |
|---|---|---|---|
| Priority: | Minor | Milestone: | Undetermined |
| Component: | Web - Project | Version: | |
| Keywords: | showlog php patch | Cc: |
Description (last modified by )
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
Change History (1)
comment:1 Changed 18 years ago by
| Component: | Server - Web - Forums → Server - Other |
|---|---|
| Description: | modified (diff) |
| Owner: | changed from Rytis to davea |

Formatted code correctly.