Issue Bug Closed

#90059PHP-Error in IpAnonymizationUtility.php

Michael Sollmann 01/06/20, 14:57 updated 02/27/20, 12:42

Description

If the processed IP addresses in IpAnonymizationUtility are not in the correct form, TYPO3 throws an uncaught exception:

Uncaught TYPO3 Exception strlen() expects parameter 1 to be string, boolean given
thrown in file […]/typo3/sysext/core/Classes/Utility/IpAnonymizationUtility.php
in line 76

It is because the preceding inet_pton() returns false if the addresses are syntactically incorrect:

$packedAddress = inet_pton($address);
$length = strlen($packedAddress);

Reviews 3