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

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this issue.

          We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported.

          If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

          Michael d.

          TW9vZGxlDQo=

          Show
          Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d. TW9vZGxlDQo=
          Hide
          Michael de Raadt added a comment -

          I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

          This is being done as part of a bulk annual clean-up of issues.

          If you still believe this is an issue in supported versions, please create a new issue.

          Show
          Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. This is being done as part of a bulk annual clean-up of issues. If you still believe this is an issue in supported versions, please create a new issue.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: