Ticket #415 (closed Defect: fixed)

Opened 2 years ago

Last modified 4 months ago

php errors in show_log.php

Reported by: mweltin Assigned to: 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

show_log.dif (0.6 kB) - added by ChristianB on 12/23/07 10:19:06.
patch for show_log.php

Change History

09/20/07 17:18:15 changed by Nicolas

  • owner changed from Rytis to davea.
  • component changed from Server - Web - Forums to Server - Other.
  • description changed.

Formatted code correctly.

09/20/07 17:18:55 changed by Nicolas

  • owner changed from davea to Rytis.
  • component changed from Server - Other to Server - Web - Project.

Whoops.

09/21/07 11:10:56 changed by davea

  • status changed from new to closed.
  • resolution set to fixed.

(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)

09/21/07 11:18:06 changed by Nicolas

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

12/23/07 10:18:11 changed by ChristianB

  • status changed from closed to reopened.
  • resolution deleted.

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

12/23/07 10:19:06 changed by ChristianB

  • attachment show_log.dif added.

patch for show_log.php

12/24/07 14:28:36 changed by Nicolas

  • keywords changed from showlog php to showlog php patch.

Add patch keyword.

(follow-up: ↓ 8 ) 01/07/08 15:27:37 changed by davea

  • status changed from reopened to closed.
  • resolution set to fixed.

(in reply to: ↑ 7 ) 01/07/08 15:35:03 changed by Nicolas

Fixed in [14485].


If this page is incomplete or incorrect, please edit it or add it to the wiki to-do list. To do this, you must be logged in; click Login or Register above.