[TYPO3-core] RFC: Bug 331: Support IPv6 addresses
Martin Kutschker
Martin.Kutschker at blackbox.net
Tue Mar 7 10:56:04 CET 2006
Michael Stucki <michael at typo3.org> writes on
Tue, 07 Mar 2006 10:41:58 +0100 (MET):
>
> Problems:
> The patch adds quite a lot of new functions. I wonder if it would make
> sense to move them into a separate file therefore?
Not really as all are related to existing functions. One is a true helper function (IPv6Hex2Bin) and maybe of general interest (normalizeIPv6).
As for the code: I'm trying to understand, but fail to see why the result of IPv6Hex2Bin is compared. Why can't simply the hex values be compared?
Really superfluos assignment, please remove:
$compare = strcmp($testBin, $baseIPBin); $success = ($compare == 0) ? true : false;
Unnecessary call of preg_replace where str_replace is sufficient:
preg_replace('/:/', '', $hex);
" instead of '
$regex = "/^(";
etc
Did not test the code itself, but wonder what's the difference between IPv4 wildcards and IPv6 prefixes. The funcion docs lack an example here.
Masi
More information about the TYPO3-team-core
mailing list