Missing close tag in debugger.inc.php Missing close tag in debugger.inc.php
 

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]

Main Menu

Missing close tag in debugger.inc.php

Started by LewisR, July 03, 2006, 04:56:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LewisR

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
Lewis Rosenthal, CNA, CLE, CLP, CWTS, EA
IT Consultant / Accountant

Nibbler

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

LewisR

#2
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:

QuoteWhen 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:

QuoteIt 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
Lewis Rosenthal, CNA, CLE, CLP, CWTS, EA
IT Consultant / Accountant