-
Bug
-
Resolution: Fixed
-
Minor
-
2.0.4, 2.1.4, 2.2.1, 2.3
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
With PHP, it is possible to pass an array as URL parameter like this:
http://www.yourphpsite.com/index.php?foo[]=bar&foo[]=bar2
I'm not sure if that kind of URL is RFC compliant, but at least it works and is sometimes used by delevopers.
I realized now that the square brackets in such a URL are removed when they are fed into a moodle_url class.
To reproduce this:
- Add a rss reader block to your course
- Add the rss feed http://www.uni-ulm.de/index.php?id=10794 to the rss reader. This feed is based on the ttnews extension for typo3.
- View the feed entries in the block
Links to a feed entry in this feed look like this:
http://www.uni-ulm.de/index.php?id=10719&tx_ttnews[tt_news]=7245&cHash=ac6e21dc232f5607fd3265ebd4339758
but they are displayed like this:
http://www.uni-ulm.de/index.php?id=10719&tx_ttnews=&cHash=ac6e21dc232f5607fd3265ebd4339758
Additionally, there is a debug message in apache log which says:
Warning: rawurlencode() expects parameter 1 to be string, array given in /pathtomoodle/lib/weblib.php on line 497 Warning: rawurlencode() expects parameter 1 to be string, array given in /pathtomoodle/lib/weblib.php on line 497
I would be grateful if you could check if URLs like these should be allowed in moodle_url class or not.