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

workaround_max_input_vars() not working well with array query params

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.7.2
    • Libraries
    • MOODLE_27_STABLE

      To reproduce:

      <?php
       
      // Put this script into the $CFG->dirroot of your Moodle and visit it from the
      // browser.
       
      require(__DIR__.'/config.php');
      require_login();
       
      if (!empty($_REQUEST)) {
          header('Content-type: text/plain');
          var_dump($_REQUEST);
          die();
      }
       
      echo('<html><body>');
      echo('<form action="" method="post">');
      echo PHP_EOL;
      for ($i = 0; $i < 1100; $i++) {
          echo('<input type="hidden" name="foo[]" value="'.$i.'" />');
          echo PHP_EOL;
      }
      echo('<button type="submit">Submit</button>');
      echo('</body></html>');
      

      Assuming you have max_input_vars set to the default 1000, you should see that the $_REQUEST now contains invalid values and some vars are duplicated.

            Unassigned Unassigned
            mudrd8mz David Mudrák (@mudrd8mz)
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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