Moodle

cleanremoteaddr notice in error log

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 2.0
  • Component/s: Events API
  • Labels:
    None
  • Environment:
    LAMP , debian Etch
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

When logging in into my moodle environment, I am getting :
NOTICE: cleanremoteaddr gives us something funny: 172.16.10.165, 172.16.10.165, 127.0.0.1, 84.195.113.230 had 2 matches, referer: http://moodle.daar.be/admin/settings.php
in my logs.

When dumping the $goodmatches array, I am getting these ip's : 127.0.0.1, 84.195.113.230. I was able to change these sources:
if (($bits[0] == 10)
6360 || ($bits[0] == 172 && $bits[1] >= 16 && $bits[1] <= 31)
6361 || ($bits[0] == 192 && $bits[1] == 168)
6362 || ($bits[0] == 169 && $bits[1] == 254))

to this:
if (($bits[0] == 10)
6360 || ($bits[0] == 172 && $bits[1] >= 16 && $bits[1] <= 31)
6361 || ($bits[0] == 192 && $bits[1] == 168)
6362 || ($bits[0] == 169 && $bits[1] == 254)
6363 || ($bits[0] == 127 ))

and it resolved the notice.

Activity

Hide
Petr Škoda (skodak) added a comment -

cleanremoteaddr() was redefined in 2.0, it now allows local and intranet addresses too.
Thanks for the report.

Petr Skoda

Show
Petr Škoda (skodak) added a comment - cleanremoteaddr() was redefined in 2.0, it now allows local and intranet addresses too. Thanks for the report. Petr Skoda

People

Vote (2)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: