Update of /cvsroot/phplib/php-lib-stable/php
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4474/php
Modified Files:
auth.inc auth4.inc crcloginform.ihtml crloginform.ihtml
layout_html.inc local.inc local4.inc loginform.ihtml menu.inc
oohforms.inc session.inc session4.inc setup.inc tpl_form.inc
Log Message:
prefer auto-globals (i.e. $_GET instead of $HTTP_GET_VARS)
allow for "register_long_arrays" INI setting in PHP5 to be turned off as this disables the longer arrays
Index: auth.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/auth.inc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** auth.inc 25 Apr 2002 02:19:31 -0000 1.7
--- auth.inc 12 Jan 2007 21:47:27 -0000 1.8
***************
*** 45,49 ****
##
function start() {
! global $sess, $HTTP_POST_VARS, $HTTP_GET_VARS;
## This is for performance, I guess but I'm not sure if it could
--- 45,54 ----
##
function start() {
! global $sess;
! if (!isset($_POST)) {
! global $HTTP_POST_VARS, $HTTP_GET_VARS;
! $_POST = $HTTP_POST_VARS;
! $_GET = $HTTP_GET_VARS;
! }
## This is for performance, I guess but I'm not sure if it could
***************
*** 68,73 ****
case "form":
# Login in progress
! if ((isset($HTTP_POST_VARS[$this->cancel_login]) && $HTTP_POST_VARS[$this->cancel_login]) or
! (isset($HTTP_GET_VARS[$this->cancel_login]) && $HTTP_GET_VARS[$this->cancel_login])) {
# If $this->cancel_login is set, delete all auth info and set
# state to "Not logged in", so eventually default or automatic
--- 73,78 ----
case "form":
# Login in progress
! if ((isset($_POST[$this->cancel_login]) && $_POST[$this->cancel_login]) or
! (isset($_GET[$this->cancel_login]) && $_GET[$this->cancel_login])) {
# If $this->cancel_login is set, delete all auth info and set
# state to "Not logged in", so eventually default or automatic
Index: auth4.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/auth4.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** auth4.inc 29 Jul 2006 10:45:56 -0000 1.2
--- auth4.inc 12 Jan 2007 21:47:27 -0000 1.3
***************
*** 61,65 ****
##
function start() {
! global $sess, $HTTP_POST_VARS, $HTTP_GET_VARS;
## This is for performance, I guess but I'm not sure if it could
--- 61,70 ----
##
function start() {
! global $sess;
! if (!isset($_POST)) {
! global $HTTP_POST_VARS, $HTTP_GET_VARS;
! $_POST = $HTTP_POST_VARS;
! $_GET = $HTTP_GET_VARS;
! }
## This is for performance, I guess but I'm not sure if it could
***************
*** 84,89 ****
case "form":
# Login in progress
! if ((isset($HTTP_POST_VARS[$this->cancel_login]) && $HTTP_POST_VARS[$this->cancel_login]) or
! (isset($HTTP_GET_VARS[$this->cancel_login]) && $HTTP_GET_VARS[$this->cancel_login])) {
# If $this->cancel_login is set, delete all auth info and set
# state to "Not logged in", so eventually default or automatic
--- 89,94 ----
case "form":
# Login in progress
! if ((isset($_POST[$this->cancel_login]) && $_POST[$this->cancel_login]) or
! (isset($_GET[$this->cancel_login]) && $_GET[$this->cancel_login])) {
# If $this->cancel_login is set, delete all auth info and set
# state to "Not logged in", so eventually default or automatic
Index: crcloginform.ihtml
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/crcloginform.ihtml,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** crcloginform.ihtml 2 Apr 2002 23:23:12 -0000 1.4
--- crcloginform.ihtml 12 Jan 2007 21:47:27 -0000 1.5
***************
*** 76,81 ****
<?php
! global $HTTP_POST_VARS;
! if ( isset($HTTP_POST_VARS["username"]) ) {
?>
<!-- failed login code -->
--- 76,84 ----
<?php
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! if ( isset($_POST["username"]) ) {
?>
<!-- failed login code -->
Index: crloginform.ihtml
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/crloginform.ihtml,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** crloginform.ihtml 2 Apr 2002 23:23:12 -0000 1.4
--- crloginform.ihtml 12 Jan 2007 21:47:27 -0000 1.5
***************
*** 74,79 ****
<?php
! global $HTTP_POST_VARS;
! if ( isset($HTTP_POST_VARS["username"]) ) {
?>
<!-- failed login code -->
--- 74,82 ----
<?php
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! if ( isset($_POST["username"]) ) {
?>
<!-- failed login code -->
Index: layout_html.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/layout_html.inc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** layout_html.inc 7 Aug 2002 19:31:33 -0000 1.4
--- layout_html.inc 12 Jan 2007 21:47:27 -0000 1.5
***************
*** 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];
--- 614,617 ----
***************
*** 640,644 ****
## if unset, assume DOCUMENT_ROOT to be the path
if (!$this->layoutpath) {
! $this->layoutpath = $HTTP_SERVER_VARS["DOCUMENT_ROOT"];
}
$SRC= $this->layouturl . $SRC;
--- 639,647 ----
## if unset, assume DOCUMENT_ROOT to be the path
if (!$this->layoutpath) {
! if (!isset($_SERVER)) {
! global $HTTP_SERVER_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
! $this->layoutpath = $_SERVER["DOCUMENT_ROOT"];
}
$SRC= $this->layouturl . $SRC;
Index: local.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/local.inc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** local.inc 2 Apr 2002 23:23:12 -0000 1.9
--- local.inc 12 Jan 2007 21:47:27 -0000 1.10
***************
*** 104,111 ****
function auth_validatelogin() {
! global $HTTP_POST_VARS;
! if(isset($HTTP_POST_VARS["username"])) {
! $this->auth["uname"] = $HTTP_POST_VARS["username"]; ## This provides access for "loginform.ihtml"
}
--- 104,114 ----
function auth_validatelogin() {
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! if(isset($_POST["username"])) {
! $this->auth["uname"] = $_POST["username"]; ## This provides access for "loginform.ihtml"
}
***************
*** 117,122 ****
" and password = '%s'",
$this->database_table,
! addslashes($HTTP_POST_VARS["username"]),
! addslashes($HTTP_POST_VARS["password"])));
while($this->db->next_record()) {
--- 120,125 ----
" and password = '%s'",
$this->database_table,
! addslashes($_POST["username"]),
! addslashes($_POST["password"])));
while($this->db->next_record()) {
***************
*** 161,173 ****
function auth_validatelogin() {
! global $HTTP_POST_VARS, $challenge;
! if(isset($HTTP_POST_VARS["username"])) {
! $this->auth["uname"] = $HTTP_POST_VARS["username"]; ## This provides access for "loginform.ihtml"
}
$this->db->query(sprintf("select user_id, perms, password ".
"from %s where username = '%s'",
$this->database_table,
! addslashes($HTTP_POST_VARS["username"])));
if ($this->db->num_rows() == 0) {
--- 164,180 ----
function auth_validatelogin() {
! global $challenge;
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! if(isset($_POST["username"])) {
! $this->auth["uname"] = $_POST["username"]; ## This provides access for "loginform.ihtml"
}
$this->db->query(sprintf("select user_id, perms, password ".
"from %s where username = '%s'",
$this->database_table,
! addslashes($_POST["username"])));
if ($this->db->num_rows() == 0) {
***************
*** 180,188 ****
$pass = $this->db->f("password");
}
! $expected_response = md5("$HTTP_POST_VARS[username]:$pass:$challenge");
## True when JS is disabled
! if ($HTTP_POST_VARS["response"] == "") {
! if ($HTTP_POST_VARS["password"] != $pass) {
return false;
} else {
--- 187,195 ----
$pass = $this->db->f("password");
}
! $expected_response = md5("$_POST[username]:$pass:$challenge");
## True when JS is disabled
! if ($_POST["response"] == "") {
! if ($_POST["password"] != $pass) {
return false;
} else {
***************
*** 193,197 ****
## Response is set, JS is enabled
! if ($expected_response != $HTTP_POST_VARS["response"]) {
return false;
} else {
--- 200,204 ----
## Response is set, JS is enabled
! if ($expected_response != $_POST["response"]) {
return false;
} else {
***************
*** 232,243 ****
function auth_validatelogin() {
! global $HTTP_POST_VARS, $challenge;
! $this->auth["uname"] = $HTTP_POST_VARS["username"]; ## This provides access for "loginform.ihtml"
$this->db->query(sprintf("select user_id, perms, password ".
"from %s where username = '%s'",
$this->database_table,
! addslashes($HTTP_POST_VARS["username"])));
if ($this->db->num_rows() == 0) {
--- 239,254 ----
function auth_validatelogin() {
! global $challenge;
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! $this->auth["uname"] = $_POST["username"]; ## This provides access for "loginform.ihtml"
$this->db->query(sprintf("select user_id, perms, password ".
"from %s where username = '%s'",
$this->database_table,
! addslashes($_POST["username"])));
if ($this->db->num_rows() == 0) {
***************
*** 250,258 ****
$pass = $this->db->f("password"); ## Password is stored as a md5 hash
}
! $expected_response = md5("$HTTP_POST_VARS[username]:$pass:$challenge");
## True when JS is disabled
! if ($HTTP_POST_VARS["response"] == "") {
! if (md5($HTTP_POST_VARS["password"]) != $pass) { ## md5 hash for non-JavaScript browsers
return false;
} else {
--- 261,269 ----
$pass = $this->db->f("password"); ## Password is stored as a md5 hash
}
! $expected_response = md5("$_POST[username]:$pass:$challenge");
## True when JS is disabled
! if ($_POST["response"] == "") {
! if (md5($_POST["password"]) != $pass) { ## md5 hash for non-JavaScript browsers
return false;
} else {
***************
*** 263,267 ****
## Response is set, JS is enabled
! if ($expected_response != $HTTP_POST_VARS["response"]) {
return false;
} else {
--- 274,278 ----
## Response is set, JS is enabled
! if ($expected_response != $_POST["response"]) {
return false;
} else {
Index: local4.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/local4.inc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** local4.inc 1 Oct 2002 16:22:03 -0000 1.1
--- local4.inc 12 Jan 2007 21:47:27 -0000 1.2
***************
*** 124,131 ****
function auth_validatelogin() {
! global $HTTP_POST_VARS;
! if(isset($HTTP_POST_VARS["username"])) {
! $this->auth["uname"] = $HTTP_POST_VARS["username"]; ## This provides access for "loginform.ihtml"
}
--- 124,134 ----
function auth_validatelogin() {
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! if(isset($_POST["username"])) {
! $this->auth["uname"] = $_POST["username"]; ## This provides access for "loginform.ihtml"
}
***************
*** 137,142 ****
" and password = '%s'",
$this->database_table,
! addslashes($HTTP_POST_VARS["username"]),
! addslashes($HTTP_POST_VARS["password"])));
while($this->db->next_record()) {
--- 140,145 ----
" and password = '%s'",
$this->database_table,
! addslashes($_POST["username"]),
! addslashes($_POST["password"])));
while($this->db->next_record()) {
***************
*** 181,193 ****
function auth_validatelogin() {
! global $HTTP_POST_VARS, $challenge;
! if(isset($HTTP_POST_VARS["username"])) {
! $this->auth["uname"] = $HTTP_POST_VARS["username"]; ## This provides access for "loginform.ihtml"
}
$this->db->query(sprintf("select user_id, perms, password ".
"from %s where username = '%s'",
$this->database_table,
! addslashes($HTTP_POST_VARS["username"])));
if ($this->db->num_rows() == 0) {
--- 184,200 ----
function auth_validatelogin() {
! global $challenge;
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! if(isset($_POST["username"])) {
! $this->auth["uname"] = $_POST["username"]; ## This provides access for "loginform.ihtml"
}
$this->db->query(sprintf("select user_id, perms, password ".
"from %s where username = '%s'",
$this->database_table,
! addslashes($_POST["username"])));
if ($this->db->num_rows() == 0) {
***************
*** 200,208 ****
$pass = $this->db->f("password");
}
! $expected_response = md5("$HTTP_POST_VARS[username]:$pass:$challenge");
## True when JS is disabled
! if ($HTTP_POST_VARS["response"] == "") {
! if ($HTTP_POST_VARS["password"] != $pass) {
return false;
} else {
--- 207,215 ----
$pass = $this->db->f("password");
}
! $expected_response = md5("$_POST[username]:$pass:$challenge");
## True when JS is disabled
! if ($_POST["response"] == "") {
! if ($_POST["password"] != $pass) {
return false;
} else {
***************
*** 213,217 ****
## Response is set, JS is enabled
! if ($expected_response != $HTTP_POST_VARS["response"]) {
return false;
} else {
--- 220,224 ----
## Response is set, JS is enabled
! if ($expected_response != $_POST["response"]) {
return false;
} else {
***************
*** 252,263 ****
function auth_validatelogin() {
! global $HTTP_POST_VARS, $challenge;
! $this->auth["uname"] = $HTTP_POST_VARS["username"]; ## This provides access for "loginform.ihtml"
$this->db->query(sprintf("select user_id, perms, password ".
"from %s where username = '%s'",
$this->database_table,
! addslashes($HTTP_POST_VARS["username"])));
if ($this->db->num_rows() == 0) {
--- 259,274 ----
function auth_validatelogin() {
! global $challenge;
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! $this->auth["uname"] = $_POST["username"]; ## This provides access for "loginform.ihtml"
$this->db->query(sprintf("select user_id, perms, password ".
"from %s where username = '%s'",
$this->database_table,
! addslashes($_POST["username"])));
if ($this->db->num_rows() == 0) {
***************
*** 270,278 ****
$pass = $this->db->f("password"); ## Password is stored as a md5 hash
}
! $expected_response = md5("$HTTP_POST_VARS[username]:$pass:$challenge");
## True when JS is disabled
! if ($HTTP_POST_VARS["response"] == "") {
! if (md5($HTTP_POST_VARS["password"]) != $pass) { ## md5 hash for non-JavaScript browsers
return false;
} else {
--- 281,289 ----
$pass = $this->db->f("password"); ## Password is stored as a md5 hash
}
! $expected_response = md5("$_POST[username]:$pass:$challenge");
## True when JS is disabled
! if ($_POST["response"] == "") {
! if (md5($_POST["password"]) != $pass) { ## md5 hash for non-JavaScript browsers
return false;
} else {
***************
*** 283,287 ****
## Response is set, JS is enabled
! if ($expected_response != $HTTP_POST_VARS["response"]) {
return false;
} else {
--- 294,298 ----
## Response is set, JS is enabled
! if ($expected_response != $_POST["response"]) {
return false;
} else {
Index: loginform.ihtml
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/loginform.ihtml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** loginform.ihtml 2 Apr 2002 23:23:12 -0000 1.3
--- loginform.ihtml 12 Jan 2007 21:47:27 -0000 1.4
***************
*** 37,42 ****
<?php
! global $HTTP_POST_VARS;
! if ( isset($HTTP_POST_VARS["username"]) ) {
?>
<!-- failed login code -->
--- 37,45 ----
<?php
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! if ( isset($_POST["username"]) ) {
?>
<!-- failed login code -->
Index: menu.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/menu.inc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** menu.inc 26 Apr 2002 12:29:40 -0000 1.4
--- menu.inc 12 Jan 2007 21:47:27 -0000 1.5
***************
*** 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
--- 54,64 ----
*/
function get() {
! if (!isset($_SERVER)) {
! global $HTTP_SERVER_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
# Determine normalized current position in tree
! $this->map = $this->normalize_pos($_SERVER["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
--- 172,183 ----
*/
function get_title() {
! if (!isset($_SERVER)) {
! global $HTTP_SERVER_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
$this->title = "";
# Determine normalized current position in tree
! $this->map = $this->normalize_pos($_SERVER["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.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** oohforms.inc 10 Apr 2006 20:02:26 -0000 1.8
--- oohforms.inc 12 Jan 2007 21:47:27 -0000 1.9
***************
*** 17,29 ****
function marshal_dispatch($m, $func) {
! global $HTTP_POST_VARS, $HTTP_POST_FILES;
$vname = $this->name;
if (isset($GLOBALS[$vname])) {
$val = $GLOBALS[$vname];
! } elseif (isset($HTTP_POST_VARS[$vname])) {
! $val = $HTTP_POST_VARS[$vname];
! } elseif (isset($HTTP_POST_FILES[$vname])) {
! $val = $HTTP_POST_FILES[$vname];
} else {
$val = '';
--- 17,33 ----
function marshal_dispatch($m, $func) {
! if (!isset($_POST)) {
! global $HTTP_POST_VARS, $HTTP_POST_FILES;
! $_POST = $HTTP_POST_VARS;
! $_FILES = $HTTP_POST_FILES;
! }
$vname = $this->name;
if (isset($GLOBALS[$vname])) {
$val = $GLOBALS[$vname];
! } elseif (isset($_POST[$vname])) {
! $val = $_POST[$vname];
! } elseif (isset($_FILES[$vname])) {
! $val = $_FILES[$vname];
} else {
$val = '';
***************
*** 174,178 ****
function get_start($jvs_name="", $method="", $action="", $target="", $form_name="") {
! global $HTTP_SERVER_VARS;
$str = "";
--- 178,185 ----
function get_start($jvs_name="", $method="", $action="", $target="", $form_name="") {
! if (!isset($_SERVER)) {
! global $HTTP_SERVER_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
$str = "";
***************
*** 184,188 ****
}
if (!$action) {
! $action = $HTTP_SERVER_VARS["PHP_SELF"];
}
if (!$target) {
--- 191,195 ----
}
if (!$action) {
! $action = $_SERVER["PHP_SELF"];
}
if (!$target) {
Index: session.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/session.inc,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** session.inc 10 Apr 2006 20:02:07 -0000 1.21
--- session.inc 12 Jan 2007 21:47:27 -0000 1.22
***************
*** 90,94 ****
function get_id($id = "") {
! global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
$this->newid=true;
--- 90,100 ----
function get_id($id = "") {
! if (!isset($_POST)) {
! global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
! $_COOKIE = $HTTP_COOKIE_VARS;
! $_POST = $HTTP_POST_VARS;
! $_GET = $HTTP_GET_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
$this->newid=true;
***************
*** 99,111 ****
switch ($this->mode) {
case "get":
! $id = isset($HTTP_GET_VARS[$this->name]) ?
! $HTTP_GET_VARS[$this->name] :
! ( isset($HTTP_POST_VARS[$this->name]) ?
! $HTTP_POST_VARS[$this->name] :
"") ;
break;
case "cookie":
! $id = isset($HTTP_COOKIE_VARS[$this->name]) ?
! $HTTP_COOKIE_VARS[$this->name] : "";
break;
default:
--- 105,117 ----
switch ($this->mode) {
case "get":
! $id = isset($_GET[$this->name]) ?
! $_GET[$this->name] :
! ( isset($_POST[$this->name]) ?
! $_POST[$this->name] :
"") ;
break;
case "cookie":
! $id = isset($_COOKIE[$this->name]) ?
! $_COOKIE[$this->name] : "";
break;
default:
***************
*** 143,150 ****
// 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))."=(.)*(&|$)", ## subst *any* preexistent sess
! "\\1", $HTTP_SERVER_VARS["QUERY_STRING"]);
}
break;
--- 149,156 ----
// Remove session ID info from QUERY String - it is in cookie
! if ( isset($_SERVER["QUERY_STRING"]) && ("" != $_SERVER["QUERY_STRING"]) ) {
! $_SERVER["QUERY_STRING"] = ereg_replace(
"(^|&)".quotemeta(urlencode($this->name))."=(.)*(&|$)", ## subst *any* preexistent sess
! "\\1", $_SERVER["QUERY_STRING"]);
}
break;
***************
*** 159,167 ****
}
! if ( isset($HTTP_SERVER_VARS["QUERY_STRING"]) && ("" != $HTTP_SERVER_VARS["QUERY_STRING"]) ) {
! $HTTP_SERVER_VARS["QUERY_STRING"] = ereg_replace(
# "(^|&)".quotemeta(urlencode($this->name))."=".$id."(&|$)",
"(^|&)".quotemeta(urlencode($this->name))."=(.)*(&|$)", ## subst *any* preexistent sess
! "\\1", $HTTP_SERVER_VARS["QUERY_STRING"]);
}
break;
--- 165,173 ----
}
! if ( isset($_SERVER["QUERY_STRING"]) && ("" != $_SERVER["QUERY_STRING"]) ) {
! $_SERVER["QUERY_STRING"] = ereg_replace(
# "(^|&)".quotemeta(urlencode($this->name))."=".$id."(&|$)",
"(^|&)".quotemeta(urlencode($this->name))."=(.)*(&|$)", ## subst *any* preexistent sess
! "\\1", $_SERVER["QUERY_STRING"]);
}
break;
***************
*** 178,182 ****
## abandon a session.
function put_id() {
! global $HTTP_COOKIE_VARS;
switch ($this->mode) {
--- 184,191 ----
## abandon a session.
function put_id() {
! if (!isset($_COOKIE)) {
! global $HTTP_COOKIE_VARS;
! $_COOKIE = $HTTP_COOKIE_VARS;
! }
switch ($this->mode) {
***************
*** 184,188 ****
$this->name = $this->cookiename == "" ? $this->classname : $this->cookiename;
SetCookie($this->name, "", 0, $this->cookie_path, $this->cookie_domain);
! $HTTP_COOKIE_VARS[$this->name] = "";
break;
--- 193,197 ----
$this->name = $this->cookiename == "" ? $this->classname : $this->cookiename;
SetCookie($this->name, "", 0, $this->cookie_path, $this->cookie_domain);
! $_COOKIE[$this->name] = "";
break;
***************
*** 238,246 ****
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"] : ""));
}
--- 247,258 ----
function self_url() {
! if (!isset($_SERVER)) {
! global $HTTP_SERVER_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
! return $this->url($_SERVER["PHP_SELF"] .
! ((isset($_SERVER["QUERY_STRING"]) && ("" != $_SERVER["QUERY_STRING"]))
! ? "?" . $_SERVER["QUERY_STRING"] : ""));
}
***************
*** 272,279 ****
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 = "&";
--- 284,294 ----
function add_query($qarray) {
! if (!isset($_SERVER)) {
! global $HTTP_SERVER_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
! if ((isset($_SERVER["QUERY_STRING"])
! && ("" != $_SERVER["QUERY_STRING"]))
|| ($this->mode == "get")) {
$sep_char = "&";
***************
*** 390,412 ****
##
function reimport_get_vars() {
! $this->reimport_any_vars("HTTP_GET_VARS");
}
function reimport_post_vars() {
! $this->reimport_any_vars("HTTP_POST_VARS");
}
function reimport_cookie_vars() {
! $this->reimport_any_vars("HTTP_COOKIE_VARS");
}
function reimport_any_vars($arrayname) {
! global $$arrayname;
! if (!is_array($$arrayname))
return;
! reset($$arrayname);
! while(list($key, $val) = each($$arrayname)) {
$GLOBALS[$key] = $val;
}
--- 405,443 ----
##
function reimport_get_vars() {
! $this->reimport_any_vars("_GET");
}
function reimport_post_vars() {
! $this->reimport_any_vars("_POST");
}
function reimport_cookie_vars() {
! $this->reimport_any_vars("_COOKIE");
}
function reimport_any_vars($arrayname) {
! $arrayname = strtoupper($arrayname);
! if (ereg('^HTTP(_.+)_VARS$', $arrayname, $reg)) {
! $arrayname = $reg[1];
! }
! if (!ereg('^_', $arrayname)) {
! $arrayname = "_" . $arrayname;
! }
! if (!isset(${$arrayname})) {
! switch($arrayname) {
! case "_COOKIE":
! case "_GET":
! case "_POST":
! global ${"HTTP".$arrayname."_VARS"};
! ${arrayname} = ${"HTTP".$arrayname."_VARS"};
! }
! }
! if (!is_array(${$arrayname}) or empty(${$arrayname})) {
return;
+ }
! reset(${$arrayname});
! while(list($key, $val) = each(${$arrayname})) {
$GLOBALS[$key] = $val;
}
***************
*** 429,439 ****
function release_token($sid = "") {
! global $HTTP_COOKIE_VARS, $HTTP_POST_VARS, $HTTP_GET_VARS,
! $HTTP_SERVER_VARS;
# set the mode for this run
if ( isset($this->fallback_mode)
&& ("get" == $this->fallback_mode)
&& ("cookie" == $this->mode)
! && (! isset($HTTP_COOKIE_VARS[$this->name])) ) {
$this->mode = $this->fallback_mode;
}
--- 460,475 ----
function release_token($sid = "") {
! if (!isset($_POST)) {
! global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
! $_COOKIE = $HTTP_COOKIE_VARS;
! $_POST = $HTTP_POST_VARS;
! $_GET = $HTTP_GET_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
# set the mode for this run
if ( isset($this->fallback_mode)
&& ("get" == $this->fallback_mode)
&& ("cookie" == $this->mode)
! && (! isset($_COOKIE[$this->name])) ) {
$this->mode = $this->fallback_mode;
}
***************
*** 444,449 ****
if ($this->newid)
{
! 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
--- 480,485 ----
if ($this->newid)
{
! if ( isset($_SERVER["HTTPS"])
! && $_SERVER["HTTPS"] == 'on' ) {
## You will need to fix suexec as well, if you
## use Apache and CGI PHP
***************
*** 454,458 ****
$this->freeze();
header("Location: " . $PROTOCOL . "://" .
! $HTTP_SERVER_VARS["HTTP_HOST"] . $this->self_url());
exit;
}
--- 490,494 ----
$this->freeze();
header("Location: " . $PROTOCOL . "://" .
! $_SERVER["HTTP_HOST"] . $this->self_url());
exit;
}
Index: session4.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/session4.inc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** session4.inc 29 Jul 2006 10:22:36 -0000 1.5
--- session4.inc 12 Jan 2007 21:47:27 -0000 1.6
***************
*** 334,343 ****
*/
function put_id() {
! global $HTTP_COOKIE_VARS;
if (get_cfg_var ('session.use_cookies') == 1) {
$cookie_params = session_get_cookie_params();
setCookie($this->name, '', 0, $cookie_params['path'], $cookie_params['domain']);
! $HTTP_COOKIE_VARS[$this->name] = "";
}
--- 334,346 ----
*/
function put_id() {
! if (!isset($_COOKIE)) {
! global $HTTP_COOKIE_VARS;
! $_COOKIE = $HTTP_COOKIE_VARS;
! }
if (get_cfg_var ('session.use_cookies') == 1) {
$cookie_params = session_get_cookie_params();
setCookie($this->name, '', 0, $cookie_params['path'], $cookie_params['domain']);
! $_COOKIE[$this->name] = "";
}
***************
*** 375,379 ****
*/
function url($url) {
! global $HTTP_COOKIE_VARS;
if ($this->trans_id_enabled)
--- 378,385 ----
*/
function url($url) {
! if (!isset($_COOKIE)) {
! global $HTTP_COOKIE_VARS;
! $_COOKIE = $HTTP_COOKIE_VARS;
! }
if ($this->trans_id_enabled)
***************
*** 386,390 ****
$url = ereg_replace("[&?]+$", "", $url);
! if (!$HTTP_COOKIE_VARS[$this->name]) {
$url .= ( strpos($url, "?") != false ? "&" : "?" ) . urlencode($this->name) . "=" . $this->id;
}
--- 392,396 ----
$url = ereg_replace("[&?]+$", "", $url);
! if (!$_COOKIE[$this->name]) {
$url .= ( strpos($url, "?") != false ? "&" : "?" ) . urlencode($this->name) . "=" . $this->id;
}
***************
*** 418,426 ****
*/
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"] : ""));
# return $this->url(getenv('REQUEST_URI'));
} // end func self_url
--- 424,435 ----
*/
function self_url() {
! if (!isset($_SERVER)) {
! global $HTTP_SERVER_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
! return $this->url($_SERVER["PHP_SELF"] .
! ((isset($_SERVER["QUERY_STRING"]) && ("" != $_SERVER["QUERY_STRING"]))
! ? "?" . $_SERVER["QUERY_STRING"] : ""));
# return $this->url(getenv('REQUEST_URI'));
} // end func self_url
***************
*** 614,618 ****
*/
function reimport_get_vars() {
! $this->reimport_any_vars("HTTP_GET_VARS");
} // end func reimport_get_vars
--- 623,627 ----
*/
function reimport_get_vars() {
! $this->reimport_any_vars("_GET");
} // end func reimport_get_vars
***************
*** 623,627 ****
*/
function reimport_post_vars() {
! $this->reimport_any_vars("HTTP_POST_VARS");
} // end func reimport_post_vars
--- 632,636 ----
*/
function reimport_post_vars() {
! $this->reimport_any_vars("_POST");
} // end func reimport_post_vars
***************
*** 632,636 ****
*/
function reimport_cookie_vars() {
! $this->reimport_any_vars("HTTP_COOKIE_VARS");
} // end func reimport_cookie_vars
--- 641,645 ----
*/
function reimport_cookie_vars() {
! $this->reimport_any_vars("_COOKIE");
} // end func reimport_cookie_vars
***************
*** 641,646 ****
*/
function reimport_any_vars($arrayname) {
! global $$arrayname;
! $GLOBALS = array_merge ($GLOBALS, $arrayname);
} // end func reimport_any_vars
--- 650,675 ----
*/
function reimport_any_vars($arrayname) {
! $arrayname = strtoupper($arrayname);
! if (ereg('^HTTP(_.+)_VARS$', $arrayname, $reg)) {
! $arrayname = $reg[1];
! }
! if (!ereg('^_', $arrayname)) {
! $arrayname = "_" . $arrayname;
! }
! if (!isset(${$arrayname})) {
! switch($arrayname) {
! case "_COOKIE":
! case "_GET":
! case "_POST":
! global ${"HTTP".$arrayname."_VARS"};
! ${arrayname} = ${"HTTP".$arrayname."_VARS"};
! }
! }
!
! if (!is_array(${$arrayname}) or empty(${$arrayname})) {
! return;
! }
!
! $GLOBALS = array_merge ($GLOBALS, ${$arrayname});
} // end func reimport_any_vars
Index: setup.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib-stable/php/setup.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** setup.inc 19 Mar 2002 22:32:25 -0000 1.2
--- setup.inc 12 Jan 2007 21:47:27 -0000 1.3
***************
*** 34,38 ****
#
! global $HTTP_SERVER_VARS;
$db = new DB_Example;
--- 34,41 ----
#
! if (!isset($_SERVER)) {
! global $HTTP_SERVER_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
$db = new DB_Example;
***************
*** 45,51 ****
$sess->id,
$now,
! $HTTP_SERVER_VARS["HTTP_REFERER"],
! $HTTP_SERVER_VARS["REMOTE_ADDR"],
! $HTTP_SERVER_VARS["HTTP_USER_AGENT"]);
$db->query($query);
--- 48,54 ----
$sess->id,
$now,
! $_SERVER["HTTP_REFERER"],
! $_SERVER["REMOTE_ADDR"],
! $_SERVER["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.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tpl_form.inc 6 Apr 2006 03:45:26 -0000 1.5
--- tpl_form.inc 12 Jan 2007 21:47:27 -0000 1.6
***************
*** 70,74 ****
# some time later.
function get_default_values() {
! global $HTTP_POST_VARS, $HTTP_POST_FILES;
if (! is_object($this->form_data)) {
$this->setup();
--- 70,78 ----
# some time later.
function get_default_values() {
! if (!isset($_POST)) {
! global $HTTP_POST_VARS, $HTTP_POST_FILES;
! $_POST = $HTTP_POST_VARS;
! $_FILES = $HTTP_POST_FILES;
! }
if (! is_object($this->form_data)) {
$this->setup();
***************
*** 79,86 ****
$vn = $el->name;
! if (isset($HTTP_POST_VARS[$vn])) {
! $vn_val = $HTTP_POST_VARS[$vn];
! } elseif (isset($HTTP_POST_FILES[$vn])) {
! $vn_val = $HTTP_POST_FILES[$vn];
} elseif (isset($GLOBALS[$vn])) {
$vn_val = $GLOBALS[$vn];
--- 83,90 ----
$vn = $el->name;
! if (isset($_POST[$vn])) {
! $vn_val = $_POST[$vn];
! } elseif (isset($_FILES[$vn])) {
! $vn_val = $_FILES[$vn];
} elseif (isset($GLOBALS[$vn])) {
$vn_val = $GLOBALS[$vn];
***************
*** 114,121 ****
# error and sets $this->error accordingly.
function validate() {
! global $HTTP_POST_VARS;
! if (isset($HTTP_POST_VARS['form_name'])) {
! $form_name = $HTTP_POST_VARS['form_name'];
} else {
$form_name = '';
--- 118,128 ----
# error and sets $this->error accordingly.
function validate() {
! if (!isset($_POST)) {
! global $HTTP_POST_VARS;
! $_POST = $HTTP_POST_VARS;
! }
! if (isset($_POST['form_name'])) {
! $form_name = $_POST['form_name'];
} else {
$form_name = '';
***************
*** 151,162 ****
# class and with ".ihtml" extension.
function display() {
! global $sess, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
// I guess some people use $PHP_SELF in their include files
// otherwise this should be removed completely - layne_weathers
! $PHP_SELF = $HTTP_SERVER_VARS["PHP_SELF"];
! if (isset($HTTP_POST_VARS['form_name'])) {
! $form_name = $HTTP_POST_VARS['form_name'];
} else {
$form_name = '';
--- 158,174 ----
# class and with ".ihtml" extension.
function display() {
! global $sess;
! if (!isset($_POST)) {
! global $HTTP_POST_VARS, $HTTP_SERVER_VARS;
! $_POST = $HTTP_POST_VARS;
! $_SERVER = $HTTP_SERVER_VARS;
! }
// I guess some people use $PHP_SELF in their include files
// otherwise this should be removed completely - layne_weathers
! $PHP_SELF = $_SERVER["PHP_SELF"];
! if (isset($_POST['form_name'])) {
! $form_name = $_POST['form_name'];
} else {
$form_name = '';
|