Opened 17 years ago

Closed 16 years ago

Last modified 15 years ago

#415 closed Defect (fixed)

php errors in show_log.php

Reported by: mweltin Owned by: Rytis
Priority: Minor Milestone: Undetermined
Component: Web - Project Version:
Keywords: showlog php patch Cc:

Description (last modified by Nicolas)

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

Attachments (1)

show_log.dif (645 bytes) - added by Christian Beer 16 years ago.
patch for show_log.php

Download all attachments as: .zip

Change History (9)

comment:1 Changed 17 years ago by Nicolas

Component: Server - Web - ForumsServer - Other
Description: modified (diff)
Owner: changed from Rytis to davea

Formatted code correctly.

comment:2 Changed 17 years ago by Nicolas

Component: Server - OtherServer - Web - Project
Owner: changed from davea to Rytis

Whoops.

comment:3 Changed 17 years ago by davea

Resolution: fixed
Status: newclosed

(In [13627]) - Added new script "update_versions_v6"; use this instead of

update_versions to add version 6 apps. It looks for API_VERSION string in main executable, adds the API version to the app_version XML, and sets min_core_version to 6 for version 6+ apps

  • API: include API_VERSION string
  • convert tabs to spaces here and there
  • scheduler: parse unused elements in <net_stats>
  • ops/show_log.php: if no URL args, just show form (fixes #415)
  • client: parse and store api_version (not used yet)

comment:4 Changed 17 years ago by Nicolas

Ugh... totally unrelated changes in a single commit again. </smallrant>

comment:5 Changed 16 years ago by Christian Beer

Resolution: fixed
Status: closedreopened

The fix introduces some bugs. I attached a patch to get it working again.

Changed 16 years ago by Christian Beer

Attachment: show_log.dif added

patch for show_log.php

comment:6 Changed 16 years ago by Nicolas

Keywords: patch added

Add patch keyword.

comment:7 Changed 16 years ago by davea

Resolution: fixed
Status: reopenedclosed

comment:8 in reply to:  7 Changed 16 years ago by Nicolas

Fixed in [14485].

Note: See TracTickets for help on using tickets.