Moodle
  1. Moodle
  2. MDL-29832

moodle_url does not support query params with . in them

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.2
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_21_STABLE
    • Rank:
      19357

      Description

      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>'));
           }
      

        Issue Links

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: