Project

General

Profile

Actions

Bug #16637

closed

recs['clear_all'] should be clear as an array

Added by Bjrn Kraus over 17 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2006-10-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The FE User Auth class (typo3/sysext/cms/tslib/class.tslib_feuserauth.php) has the possibility to automatically store form values in the session if they are submitted in the recs array. There is a switch in the record_registration() function to reset this array ($this->setKey('ses','recs','');) any time "recs[clear_all]" is submitted. If this is done and you start posting form values again in the recs array the function will throw a fatal error 'cause the result of $this->getKey('ses','recs') is a string and the following loops can't handle $recs_array (= '') as an array.

The (simple) solution is to change the reset into "$this->setKey('ses','recs',array());". Now $recs_array is an empty array and the array functions won't fail.

(issue imported from #M4367)


Files

patch.diff (531 Bytes) patch.diff Administrator Admin, 2006-10-18 15:08
4367_feusersession_arraycheck.diff (839 Bytes) 4367_feusersession_arraycheck.diff Administrator Admin, 2008-03-04 12:13
4367_v1.diff (718 Bytes) 4367_v1.diff Administrator Admin, 2009-02-24 17:31
T3X_4367-0_0_0-z-200902271456.t3x (2.85 KB) T3X_4367-0_0_0-z-200902271456.t3x Administrator Admin, 2009-02-27 14:58

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #19703: False initialization in TYPO3 basket function record_registration() in class.tslib_feuserauth.phpClosedChristian Kuhn2008-12-15

Actions
Actions #1

Updated by Bjrn Kraus over 17 years ago

I know this feature in TYPO3 isn't used by many users. But since it is a small bug and easy to fix (patch is included ;-)), it would be cool to have it in the 4.0.3 release. Thx!

Actions #2

Updated by Graham Solomon over 17 years ago

I have uploaded this as a .diff for the developers.

Just realised I ran the diff command the wrong way around, please look at the diff in reverse :)

Actions #3

Updated by Bjrn Kraus over 17 years ago

Bug still present in 4.0.3rc1. Patch (1 line of code) is included.

Actions #4

Updated by Michael Stucki over 17 years ago

You as the reporter did not confirm that the problem is solved, that was probably the main reason why I didn't look at it yet - sorry.

I think this requires some testing and shouldn't just be applied. Therefore, it would require a 2nd RC only for this change. Is it worth the hassle? I'll try to bring it into 4.0.4 / 4.1

Actions #5

Updated by Bjrn Kraus over 17 years ago

Hi Michael!

Please have a look at function record_registration(). You will see that 'recs' is treated as an array. If the array is reseted as a string ($this->setKey('ses','recs','')), the code afterwards will obviously fail.
I've applied the patch in my installations (testing and production environment) and have no problem with it.
I would realy appreciate if you could add the change before the next release so I can update my installations without applying the patch again.

BTW: I guess there will be more than one fix before the next rc ;-)

Actions #6

Updated by Bjrn Kraus over 17 years ago

Just recognized that the bug is also in the core_permalogin extension - the code is copied from the original class.

This bug seems to be critical if you use &recs['clear_all'] as additional parameter for the logout button since PHP 5.1.6 throws a fatal error:

PHP Fatal error: Cannot use string offset as an array in /home/.../htdocs/typo3conf/ext/core_permalogin/class.ux_ux_tslib_feuserauth.php on line 403

The result is a blank page.

Actions #7

Updated by Bjrn Kraus over 16 years ago

Since the same method is affected as in Bug #0006718 I'd like to send a reminder for this issue. It's still present in 4.1.3 and hasn't been fixed for almost a year now.

Actions #8

Updated by Bjrn Kraus over 16 years ago

Still present in 4.1.4.

Actions #9

Updated by Bjrn Kraus about 16 years ago

Still present in 4.1.5

Actions #10

Updated by Bjrn Kraus about 16 years ago

Still present in 4.1.6

Actions #11

Updated by Michael Stucki about 16 years ago

Hi Björn,

just to let you know that this can be in your hands to get it fixed:
http://news.typo3.org/news/article/core-development-mailinglist-now-open-for-community-involvement/

- michael

Actions #12

Updated by Bjrn Kraus about 16 years ago

@Michael: The problem is described in this bug report since 1,5 years and we've a patch for it.

Is there a need for further discussions??

Actions #13

Updated by Michael Stucki about 16 years ago

Yes. The patch needs to be tested, reviewed and approved.

Actions #14

Updated by Bjrn Kraus about 16 years ago

All I can say is that we've extensions that make use of this functionality and without the patch we get PHP errors (what is pretty obvious if you take a look at the code).

Since 1,5 years our TYPO3 instances (> 20) run fine with this patch.

Actions #15

Updated by Steffen Kamper about 16 years ago

If there is no official patch it won't be resolved.

I created a patch but with different approach. Setting array to empty string is ok, but for the loop the var has to be tested before. Please test it and report here.

Actions #16

Updated by Bjrn Kraus about 16 years ago

@Steffen: Sorry, I don't agree with you. recs is always treated as an array. If you reset it as string you run into the same problems in the setKey/getKey functions some lines above.

$this->setKey('ses','recs','') is simply wrong. It has to be $this->setKey('ses','recs',array()).

Actions #17

Updated by Bjrn Kraus over 15 years ago

This is just a reminder since this bug is active for two years now.

Actions #18

Updated by Benni Mack about 15 years ago

Now in the latest trunk!

Actions

Also available in: Atom PDF