ID:               20224
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         Output Control
 Operating System: Slackware Linux Kernel 2.4.5
 PHP Version:      4.2.2
 New Comment:

Even with register_globals off, why does it sometimes print, and
sometimes not? If it's not registering the global it should never print
the contents of the global.

Thus both:
printf("%s", $SCRIPT_NAME);
and
printf("%s", $SCRIPT_NAME . "?foo=bar");

Should never print the contents of $SCRIPT_NAME, however, in the second
instance, it prints the contents of $SCRIPT_NAME, even with
register_globals off.


Previous Comments:
------------------------------------------------------------------------

[2002-11-02 21:30:16] [EMAIL PROTECTED]

In PHP 4.2.0, the 'register_globals' setting default changed to
'off'. See http://www.php.net/release_4_2_0.php for more info.
We are sorry about the inconvenience, but this change was a necessary
part of our efforts to make PHP scripting more secure and portable.

------------------------------------------------------------------------

[2002-11-02 20:12:20] [EMAIL PROTECTED]

I'm not sure if this is a problem with constants and pre-registered
globals, or the printing mechanism.

When setting up a constant such as this:
define("SELF", $SCRIPT_NAME);

and then printing with any of the following:
echo SELF;
print(SELF);
pritnf("%s", SELF);

The output is nothing, however, if I do this:
printf("%s", SELF . "?foo=bar");

it will print properly.

I believe it's a problem with the globals, as when I try just to print
$SCRIPT_NAME or $SCRIPT_FILENAME I go no output unless I concat'ed it
to something else such as shown above.

My PHP configuration is as such:
'./configure' '--with-apxs=/usr/sbin/apxs' '--disable-short-tags'
'--enable-bcmath' '--with-zlib-dir=/usr/lib' '--enable-ftp'
'--with-gd=/usr/local/gd-1.8.4' '--enable-gd-native-ttf'
'--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--enable-sockets'
'--without-mysql' '--with-pgsql=/usr/local/pgsql'

On Slackware (8.0) Linux, Kernel 2.4.5, Apache 1.3.20. For this
particular script, I was working with sessions, and DID use the
following lines to disable some sessions settings:
ini_set("session.use_cookies", 0);
ini_set("session.use_trans_sid", 0);

The script was written prior to 4.2.2 and the auto enabled trans_sid
was creating extra data in my GET's that I had already accounted for in
my own script.

-Richard

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20224&edit=1

Reply via email to