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

64 bit support for subnet mask of type 1 in quiz

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.7.6, 1.8.7, 1.9.3
    • 1.9.1
    • Quiz
    • None
    • 64 bit CPU architecture - Linux Intel
    • MOODLE_19_STABLE
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      When using quiz restriction by ip address, using range type 1: xxx.xxx.xxx.xxx/xx, on 64 bit CPU, result is unexpected. Add the '+' line :

      +++ lib/moodlelib.php
      @@ -7029,6 +7029,7 @@
      if (strpos($subnet, '/') !== false)

      { /// type 1 list($ip, $mask) = explode('/', $subnet); $mask = 0xffffffff << (32 - $mask); + $mask = substr($mask,0,8); // Compatib. cpu 64 bit $found = ((ip2long($addr) & $mask) == (ip2long($ip) & $mask)); }

      else if (strpos($subnet, '-') !== false) {/// type 3
      $subnetparts = explode('.', $subnet);

            timhunt Tim Hunt
            dpouliot Daniel Pouliot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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