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

moodle_url does not support query params with . in them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 2.1.2
    • Libraries
    • None
    • MOODLE_21_STABLE

      Unfortunately the php parse_string() function breaks query params with '.'s in them. This was discovered in MDL-29700

      Here is a unit test which demonstrates the problem:

      diff --git a/lib/simpletest/testweblib.php b/lib/simpletest/testweblib.php
      index 0e7a39d..64498d5 100644
      --- a/lib/simpletest/testweblib.php
      +++ b/lib/simpletest/testweblib.php
      @@ -115,6 +115,14 @@ class web_test extends UnitTestCase {
               $this->assertTrue($url1->compare($url2, URL_MATCH_EXACT));
           }
       
      +    function test_moodleurl_unmodified() {
      +        $url = 'https//www.moodle.org/test_url/testing123.php?a.param=true#someanchortext';
      +
      +        $moodleurl = new moodle_url($url);
      +
      +        $this->assertIdentical($url, $moodleurl->out(false));
      +    }
      +
           public function test_html_to_text_simple() {
               $this->assertEqual("\n\n_Hello_ WORLD!", html_to_text('<p><i>Hello</i> <b>world</b>!</p>'));
           }

            Unassigned Unassigned
            poltawski Dan Poltawski
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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