Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69562

getremoteconfaddr cannot be set to HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, REMOTE_ADDR

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.9.5, 3.10.2
    • 3.5.14, 3.7.8, 3.8.5, 3.9.2
    • Installation

      A change in defaults set with MDL-69074 means it is now impossible to set CFG->getremoteaddrconf to HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, REMOTE_ADDR (value: 0).

       

      MDL-69074 did this:

          if (empty($CFG->getremoteaddrconf)) {
               // This will happen, for example, before just after the upgrade, as the
               // user is redirected to the admin screen.
      -        $variablestoskip = 0;
      +        $variablestoskip = GETREMOTEADDR_SKIP_DEFAULT;
           } else {
               $variablestoskip = $CFG->getremoteaddrconf;
           }
      

      The problem is "0", which is used by "HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, REMOTE_ADDR" equates to empty - and the empty branch of the IF no longer sets the value to 0.

      We should change `if (empty(...` to `if (!isset(...` - which allows the UI/config.php to set the value to '0'.

            dvdcastro David Castro
            aolley Adam Olley
            Jordan Tomkinson Jordan Tomkinson
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            11 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 2 minutes
                1h 2m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.