Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Missing close tag in debugger.inc.php  (Read 3318 times)

0 Members and 1 Guest are viewing this topic.

LewisR

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 15
    • Lewis' Blog
Missing close tag in debugger.inc.php
« on: July 03, 2006, 04:56:13 am »

Hmmm... Forgive me if this question is somewhat naiive, but I've d'l'd 1.4.8 a couple times, and decompressed on a couple different machines (under a couple different OSes). I'm trying to debug some lingering issues (config.php and phpinfo.php both come up blank), and I've stumbled upon something which strikes me as odd.

include/debugger.inc.php ends with the following lines of code:

8<---------------------- snip ---------------------->8

define('CAN_MOD_INI', !ereg('ini_set', ini_get('disable_functions')));

error_reporting(E_ALL);
$cpgdebugger =& new cpg_debugger();
$cpgdebugger->start();

8<---------------------- snip ---------------------->8

There's no closing ?>. Is there more code which has been corrupted/lost besides the closing tag? I haven't looked closely at the code (haven't had the time), so I'm not even clear on what it's doing and when.

TIA

Lewis

BTW: http://www.2rosenthals.net/coppermine
« Last Edit: July 03, 2006, 05:14:38 pm by Nibbler »
Logged
Lewis Rosenthal, CNA, CLE, CLP, CWTS, EA
IT Consultant / Accountant

Nibbler

  • Guest
Re: Missing close tag in debugger.inc.php
« Reply #1 on: July 03, 2006, 01:06:30 pm »

The closing ?> is not required, that is the end of the file.
Logged

LewisR

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 15
    • Lewis' Blog
Re: Missing close tag in debugger.inc.php
« Reply #2 on: July 03, 2006, 04:56:50 pm »

Evolution of my grasp of this concept:

Disbelief -> Research -> Understanding...:

Huh?? How would the parser know that the php is finished? From http://us3.php.net/manual/en/language.basic-syntax.php:

Quote
When PHP parses a file, it looks for opening and closing tags, which tell PHP to start and stop interpreting the code between them. Parsing in this manner allows php to be embedded in all sorts of different documents, as everything outside of a pair of opening and closing tags is ignored by the PHP parser.

What truly puzzles me, though, is that php -l seems to validate the code. So, I must assume you are correct in stating that the closing tag is not necessary. I've just never seen this. Certainly, http://en.wikibooks.org/wiki/Programming:Complete_PHP/Escaping_from_HTML seems to indicate as much, and evidently, this coding may even be desirable:

Quote
It may be helpful to omit the last PHP closing tag (see above) if one is including or requiring a file processing code before a cookie is sent (see above), or if one is using output buffering and doesn't wish for additional whitespace at the end of the file to be sent to the browser. See also instruction separation.

So, I stand corrected. Thanks for teaching me something of PHP which I did not know before!

Lewis
« Last Edit: July 05, 2006, 04:45:53 am by LewisR »
Logged
Lewis Rosenthal, CNA, CLE, CLP, CWTS, EA
IT Consultant / Accountant
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.