Update of /cvsroot/phplib/php-lib-stable/php
In directory usw-pr-cvs1:/tmp/cvs-serv22359/php
Modified Files:
layout_html.inc menu.inc oohforms.inc session.inc setup.inc
tpl_form.inc
Log Message:
Fixed [ #446455 ] Failures with register_globals off
Index: layout_html.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/layout_html.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** layout_html.inc 12 Jul 2000 18:22:34 -0000 1.2
--- layout_html.inc 19 Mar 2002 22:32:25 -0000 1.3
***************
*** 77,81 ****
## these vars are needed for generating an IMG-Tag
## layouturl: s.th. like "http://hugo.bla/"
! ## layoutpath: if empty it will be set on first call to $DOCUMENT_ROOT
##
var $layouturl = '';
--- 77,81 ----
## these vars are needed for generating an IMG-Tag
## layouturl: s.th. like "http://hugo.bla/"
! ## layoutpath: if empty it will be set on first call to DOCUMENT_ROOT
##
var $layouturl = '';
***************
*** 614,618 ****
## server (hm, this is difficult!)
function doc_pic ($a,$showdetails=false,$force=false) {
! GLOBAL $DOCUMENT_ROOT;
$SRC=$a[SRC];
$path=$a[path];
--- 614,618 ----
## server (hm, this is difficult!)
function doc_pic ($a,$showdetails=false,$force=false) {
! GLOBAL $HTTP_SERVER_VARS;
$SRC=$a[SRC];
$path=$a[path];
***************
*** 638,644 ****
}
if (ereg("^/",$SRC)) {
! ## if unset, assume $DOCUMENT_ROOT to be the path
if (!$this->layoutpath) {
! $this->layoutpath=$GLOBALS[DOCUMENT_ROOT];
}
$SRC= $this->layouturl . $SRC;
--- 638,644 ----
}
if (ereg("^/",$SRC)) {
! ## if unset, assume DOCUMENT_ROOT to be the path
if (!$this->layoutpath) {
! $this->layoutpath = $HTTP_SERVER_VARS["DOCUMENT_ROOT"];
}
$SRC= $this->layouturl . $SRC;
Index: menu.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/menu.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** menu.inc 20 Aug 2001 06:35:00 -0000 1.2
--- menu.inc 19 Mar 2002 22:32:25 -0000 1.3
***************
*** 54,61 ****
*/
function get() {
! global $PHP_SELF;
# Determine normalized current position in tree
! $this->map = $this->normalize_pos($PHP_SELF);
# Determine menu levels up from current position
--- 54,61 ----
*/
function get() {
! global $HTTP_SERVER_VARS;
# Determine normalized current position in tree
! $this->map = $this->normalize_pos($HTTP_SERVER_VARS["PHP_SELF"]);
# Determine menu levels up from current position
***************
*** 169,177 ****
*/
function get_title() {
! global $PHP_SELF;
$this->title = "";
# Determine normalized current position in tree
! $this->map = $this->normalize_pos($PHP_SELF);
# Determine menu levels up from current position
--- 169,177 ----
*/
function get_title() {
! global $HTTP_SERVER_VARS;
$this->title = "";
# Determine normalized current position in tree
! $this->map = $this->normalize_pos($HTTP_SERVER_VARS["PHP_SELF"]);
# Determine menu levels up from current position
Index: oohforms.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/oohforms.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** oohforms.inc 26 Aug 2001 04:56:13 -0000 1.2
--- oohforms.inc 19 Mar 2002 22:32:25 -0000 1.3
***************
*** 157,161 ****
function get_start($jvs_name="",$method="",$action="",$target="",$form_name="") {
! global $PHP_SELF;
$str = "";
--- 157,161 ----
function get_start($jvs_name="",$method="",$action="",$target="",$form_name="") {
! global $HTTP_SERVER_VARS;
$str = "";
***************
*** 164,168 ****
$this->n = 0;
if (!$method) $method = "POST";
! if (!$action) $action = $PHP_SELF;
if (!$target) $target = "_self";
--- 164,168 ----
$this->n = 0;
if (!$method) $method = "POST";
! if (!$action) $action = $HTTP_SERVER_VARS["PHP_SELF"];
if (!$target) $target = "_self";
Index: session.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/session.inc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** session.inc 6 Jan 2002 15:10:46 -0000 1.13
--- session.inc 19 Mar 2002 22:32:25 -0000 1.14
***************
*** 86,90 ****
function get_id($id = "") {
! global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $QUERY_STRING;
$newid=true;
--- 86,90 ----
function get_id($id = "") {
! global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
$newid=true;
***************
*** 126,140 ****
// Remove session ID info from QUERY String - it is in cookie
! if ( isset($QUERY_STRING) && ("" != $QUERY_STRING) ) {
! $QUERY_STRING = ereg_replace(
"(^|&)".quotemeta(urlencode($this->name))."=".$id."(&|$)",
! "\\1", $QUERY_STRING);
}
break;
case "get":
! if ( isset($QUERY_STRING) && ("" != $QUERY_STRING) ) {
! $QUERY_STRING = ereg_replace(
"(^|&)".quotemeta(urlencode($this->name))."=".$id."(&|$)",
! "\\1", $QUERY_STRING);
}
break;
--- 126,140 ----
// Remove session ID info from QUERY String - it is in cookie
! if ( isset($HTTP_SERVER_VARS["QUERY_STRING"]) && ("" != $HTTP_SERVER_VARS["QUERY_STRING"]) ) {
! $HTTP_SERVER_VARS["QUERY_STRING"] = ereg_replace(
"(^|&)".quotemeta(urlencode($this->name))."=".$id."(&|$)",
! "\\1", $HTTP_SERVER_VARS["QUERY_STRING"]);
}
break;
case "get":
! if ( isset($HTTP_SERVER_VARS["QUERY_STRING"]) && ("" != $HTTP_SERVER_VARS["QUERY_STRING"]) ) {
! $HTTP_SERVER_VARS["QUERY_STRING"] = ereg_replace(
"(^|&)".quotemeta(urlencode($this->name))."=".$id."(&|$)",
! "\\1", $HTTP_SERVER_VARS["QUERY_STRING"]);
}
break;
***************
*** 210,217 ****
function self_url() {
! global $PHP_SELF, $QUERY_STRING;
! return $this->url($PHP_SELF.
! ((isset($QUERY_STRING) && ("" != $QUERY_STRING)) ? "?".$QUERY_STRING : ""));
}
--- 210,218 ----
function self_url() {
! global $HTTP_SERVER_VARS;
! return $this->url($HTTP_SERVER_VARS["PHP_SELF"] .
! ((isset($HTTP_SERVER_VARS["QUERY_STRING"]) && ("" != $HTTP_SERVER_VARS["QUERY_STRING"]))
! ? "?" . $HTTP_SERVER_VARS["QUERY_STRING"] : ""));
}
***************
*** 226,233 ****
function add_query($qarray) {
! global $PHP_SELF;
! global $QUERY_STRING;
! if ((isset($QUERY_STRING) && ("" != $QUERY_STRING))
|| ($this->mode == "get")) {
$sep_char = "&";
--- 227,234 ----
function add_query($qarray) {
! global $HTTP_SERVER_VARS;
! if ((isset($HTTP_SERVER_VARS["QUERY_STRING"])
! && ("" != $HTTP_SERVER_VARS["QUERY_STRING"]))
|| ($this->mode == "get")) {
$sep_char = "&";
***************
*** 384,388 ****
function release_token($sid = "") {
global $HTTP_COOKIE_VARS, $HTTP_POST_VARS, $HTTP_GET_VARS,
! $HTTP_HOST, $HTTPS;
if ( isset($this->fallback_mode)
--- 385,389 ----
function release_token($sid = "") {
global $HTTP_COOKIE_VARS, $HTTP_POST_VARS, $HTTP_GET_VARS,
! $HTTP_SERVER_VARS;
if ( isset($this->fallback_mode)
***************
*** 406,418 ****
$this->mode = $this->fallback_mode;
! if ( isset($HTTPS) && $HTTPS == 'on' ) {
## You will need to fix suexec as well, if you
## use Apache and CGI PHP
! $PROTOCOL='https';
} else {
! $PROTOCOL='http';
}
header("Status: 302 Moved Temporarily");
! header("Location: ". $PROTOCOL. "://".$HTTP_HOST.$this->self_url());
exit;
}
--- 407,421 ----
$this->mode = $this->fallback_mode;
! if ( isset($HTTP_SERVER_VARS["HTTPS"])
! && $HTTP_SERVER_VARS["HTTPS"] == 'on' ) {
## You will need to fix suexec as well, if you
## use Apache and CGI PHP
! $PROTOCOL = 'https';
} else {
! $PROTOCOL = 'http';
}
header("Status: 302 Moved Temporarily");
! header("Location: " . $PROTOCOL . "://" .
! $HTTP_SERVER_VARS["HTTP_HOST"] . $this->self_url());
exit;
}
Index: setup.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/setup.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** setup.inc 17 Apr 2000 16:40:13 -0000 1.1.1.1
--- setup.inc 19 Mar 2002 22:32:25 -0000 1.2
***************
*** 34,38 ****
#
! global $HTTP_REFERER, $REMOTE_ADDR, $HTTP_USER_AGENT;
$db = new DB_Example;
--- 34,38 ----
#
! global $HTTP_SERVER_VARS;
$db = new DB_Example;
***************
*** 45,51 ****
$sess->id,
$now,
! $HTTP_REFERER,
! $REMOTE_ADDR,
! $HTTP_USER_AGENT);
$db->query($query);
--- 45,51 ----
$sess->id,
$now,
! $HTTP_SERVER_VARS["HTTP_REFERER"],
! $HTTP_SERVER_VARS["REMOTE_ADDR"],
! $HTTP_SERVER_VARS["HTTP_USER_AGENT"]);
$db->query($query);
Index: tpl_form.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/tpl_form.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tpl_form.inc 12 Jul 2000 18:22:35 -0000 1.2
--- tpl_form.inc 19 Mar 2002 22:32:25 -0000 1.3
***************
*** 135,139 ****
global $sess;
global $form_name;
! global $PHP_SELF;
if (! is_object($this->form_data)) {
--- 135,143 ----
global $sess;
global $form_name;
!
! // I guess some people use $PHP_SELF in their include files
! // otherwise these should be removed completely - layne_weathers
! global $HTTP_SERVER_VARS;
! $PHP_SELF = $HTTP_SERVER_VARS["PHP_SELF"]
if (! is_object($this->form_data)) {
|