php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21886 parameters sometimes not submitted *UPDATE*
Submitted: 2003-01-26 07:52 UTC Modified: 2003-05-16 05:48 UTC
Votes:61
Avg. Score:4.7 ± 0.7
Reproduced:43 of 44 (97.7%)
Same Version:26 (60.5%)
Same OS:20 (46.5%)
From: technik at infoworxx dot de Assigned:
Status: Closed Package: Session related
PHP Version: 4.3.2RC3-dev OS: Linux 7.2
Private report: No CVE-ID: None
 [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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-13 02:01 UTC] sniper@php.net
Please provide a complete but short example 
that _clearly_ shows the problem.

 [2003-02-14 04:21 UTC] technik at infoworxx dot de
I am sorry, actually I do not have time, I hope I can give you an example in the next two days - sorry for that (but your first reply took more than two days :-).

But - it is NOT an misunderstanding how sessions work. I am using sessions since the beginning of PHP 4 and the same code is running under 4.2.3 perfect.

Regards,
Sebastian
 [2003-02-15 10:13 UTC] sniper@php.net
Then you must also know that some behaviour of them was fixed in 4.3.0 and most likely you're just relying on the
broken behaviour...can't really tell without a short and 
complete example script. 

 [2003-02-22 20:17 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-03-04 07:59 UTC] technik at infoworxx dot de
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
 [2003-03-04 08:01 UTC] technik at infoworxx dot de
One more thing - same behavior under 4.3.0 and 4.3.1 !
 [2003-03-05 03:36 UTC] technik at infoworxx dot de
Hi,

with the CVS Version it is the same behaviour - the function does not recieve the parameters.

Regards,
Sebastian
 [2003-03-05 06:39 UTC] sniper@php.net
updated the version..

 [2003-03-05 07:37 UTC] technik at infoworxx dot de
Hi !

means this that you have fixed it (in the newest cvs) ?
 [2003-03-05 12:36 UTC] sniper@php.net
No, I just updated the version in this report to reflect the latest version you have tested this possible bug to exist in.

 [2003-03-05 12:40 UTC] sniper@php.net
Try adding 'error_reporting(E_ALL);' as the first line in your script. And see what errors you get..

 [2003-03-06 06:49 UTC] technik at infoworxx dot de
After adding the script gives the following notice:


Notice: Undefined variable: uninitalized in /delequa/webs/192168002075/www/php-4.3.x-test/index.phtml on line 19


The behaviour is the same.
 [2003-04-01 03:16 UTC] technik at infoworxx dot de
Hi @all,

is there anybody out there in the galaxy who cares about this nasty bug ???? There are 50 Votes, with an Avg. Score of 4.7 and 36 reproduced. 

There is a clean code to reproduce the bug (4 Mar 7:59am CST) and the actual 4.3.2RC1 has the same bahaviour.

Anybody who cares ?

Sebastian
 [2003-05-11 06:21 UTC] rrichards@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

If running with register globals off, make sure you set:
session.bug_compat_42 = 1
session.bug_compat_warn = 0

Needed if you really want $sess_action="two" to be set in your session.
 [2003-05-12 03:52 UTC] technik at infoworxx dot de
Hi !

I have tried it with the snapshot-version. It does NOT run.

I have set 
register_globals=on

At first I have tried without the paramters 
session.bug_compat_42
session.bug_compat_warn

It does not work. 

Then I have tried to set
session.bug_compat_42 = 1
session.bug_compat_warn = 0

It does not work, too.

Regards,
Sebastian
 [2003-05-16 05:48 UTC] technik at infoworxx dot de
With the latest CVS-Snapshot (PHP4-STABLE) it works now (20030516).

Thanks !!!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 08:01:32 2024 UTC