Bug #23074
closed
PHP Warning in class.t3lib_matchcondition_abstract.php if bowser is unknown
Added by Mark Iron about 14 years ago.
Updated almost 14 years ago.
Description
Preface:
In this issue several problems were reported, which are now dealt with as seperated issues.
This issue only is to deal with the problem in class.t3lib_matchcondition_abstract.php.
===
When an unkown user agent is requesting a page, the browser detection code fails.
PHP Warning: Invalid argument supplied for foreach() in t3lib/matchcondition/class.t3lib_matchcondition_abstract.php line 222
(issue imported from #M14970)
Files
I would like change the severity from minor to major but don't know how to do it "after" the issue has been inserted.
The content of the attached file is a part of a log file without the date/time in the front of each line (check the creating commands)
Please report these problems to the extension's authors. In my eyes, this is no core issue (if you think so, please reopen this issue!).
Thanks!
I have splittet it in two extensions issues:
http://bugs.typo3.org/view.php?id=14976
new issue for sr_feuser_register: Core: Error handler (FE): PHP Warning: explode() expects parameter 2 to be string
and another one for mail_direct:
http://bugs.typo3.org/view.php?id=14973
Missing category checkboxes on the recipient list page [BE] after installing direct_mail extension
However I guess that at least one of the following two errors is core specific:
t3lib/matchcondition/class.t3lib_matchcondition_abstract.php line 222
typo3/sysext/cms/tslib/class.tslib_content.php line 6687
Thank you for your help :)
The error in class.t3lib_matchcondition_abstract.php is core-related.
The function t3lib_utility_client::getBrowserInfo() was written new for 4.4. Within the return-array there is a new key called 'all', should containing an array, which is now used for the condition-testing in t3lib_matchcondition_abstract->evaluateConditionCommon().
But if the browser is 'unknown' neither the new key 'all', nor the key 'version' are (empty) initialized for the return array.
Due to this, the browser-check produces the given warning while trying to match a ts [browser = ...] condition.
I have added both keys with empty string/array ...
see patch
I am not able to reproduce the error from class.tslib_content.php line 6687
I modified the report accordingly after the different issues were split up.
Thank you very much. I have inserted the changes and didn't get the error message any more (t3lib/matchcondition/class.t3lib_matchcondition_abstract.php line 222) however I will test it more carefully and leave a notice if it appears again in the logfile.
It looks like the error in tslib_content is also caused by sr_feuserregister:
Core: Error handler (FE): PHP Warning: Parameter 2 to tx_sremailsubscribe_pi1::main() expected to be a reference, value given in typo3_src-4.4/typo3/sysext/cms/tslib/class.tslib_content.php line 6687
So I would stick to the matchcondition issue here. Caspar, can you send this to the core list, please?
added new patch, where array key 'version' is empty and not set to 'unknown'
If the error in tslib_content is caused by sr_email_subscribe, there has to be a new BT entry for this, or??
Committed to 4_4 rev 8159 and trunk rev 8160
Also available in: Atom
PDF