[TYPO3-core] RFC: function cmpIPv4 - PHP 5.1.12 warning with wrong usage of array index

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Fri Jun 30 11:52:54 CEST 2006


Franz Holzinger schrieb:
> Hello,
> 
> 
> This is a CVS patch request.
> 
> Type: Bugfix
> 
> Branch:  TYPO3_4-0
> 
> Description:
> 
> The following line causes a lot of the same error message in PHP 5.1.12.
> You will get this on the screen with phpMyAdmin if you have turned on
> the display of error messages in php.ini and the install tool.
> 
> functions cmpIPv4 and cmpIPv6
> 
> list($test,$mask) = explode('/',$test);

So can avoid all the changes from $test to $testArray (testef with E_ALL).

$test = explode('/',$test);
$mask = (isset($test[1])) ? $test[1] : '';
$test = $test[0];

But it's going to be a PITA if we try to avoid *notices*. If you notices 
such stuff how about all the unitinitalited-variables warnings which must 
be all over the place.

Masi



More information about the TYPO3-team-core mailing list