The session list within the AccountSecurityPage relies on all sessions storing
valid IP addresses. When using `cli.php` no `REMOTE_ADDR` will be available and
an empty string was being stored. As the empty string is not a valid IP address
the `\wcf\util\IpAddress` class errored out.
Fix this issue by always returning a syntactically valid IP address from
`UserUtil::getIpAddress()`. `::` is being used which is commonly used to
indicate unknown IP addresses and must never appear within valid IP packets.
*/
public static function getIpAddress()
{
- $REMOTE_ADDR = '';
- if (isset($_SERVER['REMOTE_ADDR'])) {
+ $REMOTE_ADDR = '::';
+ if (!empty($_SERVER['REMOTE_ADDR'])) {
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
}