|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-26 07:52 UTC] technik at infoworxx dot de
Hi @all,
I have just mentioned a strange behaviour of PHP 4.3.0.
At first of all: I have recompiled my hole config with PHP 4.2.3 and my program runs - without any change - fine !
Just have a look at the source:
In index2.phtml:
-----
$dummy="index2.phtml?step=printchecklist&mode=".$mode."&besuchid=".$besuch_id."&hid=".$form_hid."&sessvalid=".$s_sessvalid;
if ($debug) @error_log("Redirect [origin=checklist] to: ".$dummy,0);
$session->redirectTo($dummy);
-----
in my Session-Class:
-----
function redirectTo($pathInfo) {
if ($this->debug) @error_log("SESSION [redirectTo]: Parameter: ".$pathInfo,0);
[.......]
}
-----
and now my error-log:
-----
[Sun Jan 26 14:24:43 2003] [error] Redirect [origin=checklist] to: index2.phtml?step=printchecklist&mode=&besuchid=&hid=16&sessvalid=951227295
[Sun Jan 26 14:24:43 2003] [error] SESSION [redirectTo]: Parameter:
-----
The Parameter given to $session->redirectTo will not be recieved by the function. When I try this several times (my "$dummy" does NOT !!! change) after the second or the third try it works.
Again - with 4.2.3 and excatly the same config *everything* is fine.
Regards,
Sebastian
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 22:00:01 2025 UTC |
Hi @all, sorry for that long time to answer - a lot things to do in the last weeks :-( Finally I have figured out under what circumstances the behaviour occurs. Here is an clean sample code: ---- index.phtml ---- <? // Classes // require_once "foo-class.php4"; // test-class // $foo = new fooclass(); @error_log("Start with: ".$_SERVER["REQUEST_URI"],0); // start a session. session_start(); // if $unintialized is set to something, everything is fine. // $uninitalized="test"; $save_hid=$uninitalized; $sess_action="two"; session_register('sess_action'); session_register('save_hid'); // and now the problem - $dummy will not be given to the function $dummy=$_SERVER["PHP_SELF"]."?step=2"; @error_log("var dummy: ".$dummy,0); $foo->samplefunc($dummy); exit; ?> ---- END index.phtml ---- ---- foo-class.php4 ---- <? // file: foo-class.php4 class fooclass { function samplefunc($pathInfo) { @error_log("SESSION [redirectTo]: Parameter: ".$pathInfo,0); } } ?> ---- END foo-class.php4 ---- And here my Syslog when I try to open the page the first time - when I do an refresh everything is fine !!!!! ---- error_log ---- [Tue Mar 4 14:53:38 2003] [error] Start with: /php-4.3.x-test/ [Tue Mar 4 14:53:38 2003] [error] var dummy: /php-4.3.x-test/index.phtml?step=2 [Tue Mar 4 14:53:38 2003] [error] SESSION [redirectTo]: Parameter: ---- END error_log ---- As you can see, the function in my foo-class do not recieve their parameters. This only happens if the $unintialized var in index.phtml is uninitialized. If you need anything more, please let me know. Again - with 4.2.3 there were no those behaviour. I know - an unintilized var is not good - but I guess there should not be such an error. Regards, Sebastian