Moodle
  1. Moodle
  2. MDL-38637

CAS Authentication : Undefined index: QUERY_STRING when executing cron

    Details

    • Testing Instructions:
      Hide
      • Enable CAS Authentication in the site administration
      • Run the cron from cli
      • There should be no "Undefined index: QUERY_STRING " error displayed
      • Addionnal validation : Be sure that you can still connect with CAS and that there's no error in the process
      Show
      Enable CAS Authentication in the site administration Run the cron from cli There should be no "Undefined index: QUERY_STRING " error displayed Addionnal validation : Be sure that you can still connect with CAS and that there's no error in the process
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
      git@github.com:StudiUM/moodle.git
    • Pull 2.4 Branch:
      MDL-38637-moodle24
    • Pull Master Branch:
      MDL-38637-master
    • Rank:
      48672

      Description

      There's an "Undefined index: QUERY_STRING" error when you run the cron and that the CAS Authentication is enabled.

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting that and providing a fix.

        Show
        Michael de Raadt added a comment - Thanks for reporting that and providing a fix.
        Hide
        Jason Fowler added a comment - - edited

        Can I recommend a change to the patch, just to make it cleaner:

        $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
        if (isset($_SERVER['QUERY_STRING'])) { {
            $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
        } 
        
        Show
        Jason Fowler added a comment - - edited Can I recommend a change to the patch, just to make it cleaner: $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; if (isset($_SERVER['QUERY_STRING'])) { { $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; }
        Hide
        Jean-Philippe Gaudreau added a comment -

        Hi Jason,

        You're totally right! Thx!

        Putting back to peer review.

        Show
        Jean-Philippe Gaudreau added a comment - Hi Jason, You're totally right! Thx! Putting back to peer review.
        Hide
        Jason Fowler added a comment -

        Much better, thank you. Pushing for integration now.

        Show
        Jason Fowler added a comment - Much better, thank you. Pushing for integration now.
        Hide
        Dan Poltawski added a comment -

        Integrated to master, 24 and 23 - thanks Jean-Philippe

        Show
        Dan Poltawski added a comment - Integrated to master, 24 and 23 - thanks Jean-Philippe
        Hide
        David Monllaó added a comment -

        Hi Rossie, there is a VM in the shared folder ready to test this kind of issues

        Show
        David Monllaó added a comment - Hi Rossie, there is a VM in the shared folder ready to test this kind of issues
        Hide
        Rossiani Wijaya added a comment -

        This is working as expected.

        Tested for 2.3, 2.4 and master

        Test passed.

        Show
        Rossiani Wijaya added a comment - This is working as expected. Tested for 2.3, 2.4 and master Test passed.
        Hide
        Dan Poltawski added a comment -

        Blooming Marvelous! It's time for a knees up - your changes are upstream!

        Thanks for making Moodle better!

        Toodle pip

        Show
        Dan Poltawski added a comment - Blooming Marvelous! It's time for a knees up - your changes are upstream! Thanks for making Moodle better! Toodle pip

          People

          • Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: