Project

General

Profile

Actions

Bug #22398

closed

Nagging error notices in class.t3lib_div.php / $_SERVER assumptions.

Added by Dave over 14 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-04-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

A bunch of nagging error notices:

Notice: Undefined index: t3lib/class.t3lib_div.php in typo3_src-4.3.2/t3lib/class.t3lib_div.php on line 5390
Notice: Undefined index: SSL_SESSION_ID in typo3_src-4.3.2/t3lib/class.t3lib_div.php on line 3842
Notice: Undefined index: HTTPS in typo3_src-4.3.2/t3lib/class.t3lib_div.php on line 3842
Notice: Undefined index: ORIG_SCRIPT_NAME in typo3_src-4.3.2/t3lib/class.t3lib_div.php on line 3680
Notice: Undefined index: systemLog in typo3_src-4.3.2/t3lib/class.t3lib_div.php on line 5343
Notice: Undefined offset: 1 in typo3_src-4.3.2/t3lib/class.t3lib_div.php on line 5353
Notice: Undefined index: systemLog in typo3_src-4.3.2/t3lib/class.t3lib_div.php on line 5395

I was trying to debug a plugin i am working on, and there is nothing more annoying than seeing error notices appearing from code you are not interested in.

Just my 2c, there seems to be too many assumptions made on the existence of $_SERVER vars before using them. You have to be careful with environment variables because they may not exist from one hosting environment to the next.

I am guessing there is more of these around the place. You may hear from me again.
(issue imported from #M14030)


Files

patch.diff (531 Bytes) patch.diff Administrator Admin, 2010-04-07 17:13

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #15795: Some notices and warnings in class.t3lib_cs.php (2 things)ClosedChris topher2006-03-09

Actions
Related to TYPO3 Core - Bug #15025: PHP NoticesClosedChris topher2005-10-11

Actions
Has duplicate TYPO3 Core - Bug #20266: Typo3 raises many PHP Notice errors in php.logClosedChristian Kuhn2009-04-02

Actions
Actions #1

Updated by Christian Kuhn over 14 years ago

It's a real challenge to get rid of all php notice-level errors in v4 core. This is more or less a historic problem, we are aware of this.

So until now nobody went ahead trying to fix at least some of them, error_reporting by default is set to warning level or greater.

But patches for notice level errors are certainly welcome. Please split them into small parts, fixing only one issue at a time (which makes reviews easy), keep performance effects for often used methods in mind and begin to send clean patches to the core list.

http://typo3.org/teams/core/core-mailinglist-rules/

Actions #2

Updated by Dave over 14 years ago

yes I just discovered lots more. i think my work will be cut out for me. ;-)

you will find that fixing these notices will actually improve the performance of the cms generally, particularly fixing undefined indexes, as PHP will skip logically irrelevant procedures faster if you check for variable existence before you make a series of operands depending on it. it all adds up.

It is a shame they have been ignored up until now, from the quantity of notices, the performance hit is probably quite large. I will take your advice and send patches for one issue at a time. tnx for your effort.

Actions #3

Updated by Dave over 14 years ago

Sorry, just a side note to the patch I supplied:

These notices that I try to get fixed are only occurring when you are trying to develop an output from an extension via eID $_GET var.

For extension development, when you are trying to get the raw output from an extension via the 'eID' method you expect little CMS involvement other than a call to bootstrap the extension, particularly when you make no other calls to CMS internals.

I know there are 10's of 100's of notices elsewhere, but these ones I feel are a little more critical to fix when you are trying to develop third-party code that should basically side step the internals of the CMS, but still be loaded as an extension.

I feel at this level it really should be 100% error free, as it is a cutting point between the CMS and pure third-party code.

If you heavily develop an extension using CMS internal methods then you should expect 'historical' error notices, but if you just access the extension 'direct' you should get zero errors from the CMS, so that when you develop with an IDE and a debugger at error_level "11", the only nags you get are with the pure third-party code you wrote.

So I hope to fix at least 7 or so notices out of a 1000+, hopefully it should be child's play to remedy.

Actions #4

Updated by Chris topher over 14 years ago

Hi Dave,

to get your patch discussed and finally included, push it to Gerrit!

Check out:
http://wiki.typo3.org/Git_Gerrit

Thanks for your work!

Actions #5

Updated by Susanne Moog over 13 years ago

  • Status changed from Needs Feedback to Accepted
  • Target version deleted (0)
  • Complexity set to easy
Actions #6

Updated by Alexander Opitz over 11 years ago

  • Status changed from Accepted to Needs Feedback

does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)

Actions #7

Updated by Alexander Opitz about 11 years ago

  • Status changed from Needs Feedback to Closed
  • Is Regression set to No

No feedback for over 90 days.

Actions

Also available in: Atom PDF