Support Requests item #761127, was opened at 2003-06-26 11:04
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=403612&aid=761127&group_id=31885
Category: None
Group: None
Status: Open
Priority: 5
Submitted By: Guy Parker (guyparker)
Assigned to: Nobody/Anonymous (nobody)
Summary: oohforms load_defaults() not working with reg globals off?
Initial Comment:
I have been trying to use oohforms with register globals off. I
have tried the patch available from http://www.sanisoft.com/
phplib/oohforms_patch.zip and also the latest snapshot
(0.74.20021126) available from http://phplib.sourceforge.net/
snapshots/ but still have a problem.
I have a form that loads values from MySQL into variables with
the same name as the form objects. Older versions of phplib
would load these values as the defaults with the load_default()
function. I don't get this behavior with the versions of phplib that
claim to work with register global off. Even if I turn register
globals on the old behavior does not return.
I don't claim to fully understand the oohforms code but I have
found that the following code seems to work.
function marshal_dispatch($m,$func) {
if (count($HTTP_POST_VARS) == 0) {
//No post vars...this old oohforms code loads defaults correctly
$vname = $this->name;
global $$vname;
return $this->$func($$vname);
} else {
//Post vars present...this is the latest oohforms code
global $HTTP_POST_VARS;
$vname = $this->name;
return $this->$func($HTTP_POST_VARS["$vname"]);
}
}
My concern is that this probably isn't the best way to correct the
problem and would appreciate any better alternatives.
Thanks in advance!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=403612&aid=761127&group_id=31885
|