Permalink
Browse files

MDL-41623 ensure all links are valid urls

For 23 and 24 we are modifying the default Sanitizer. Note that
for 24 and upwards we are doing the same with our extended
Sanitizer. So this is just an interim hack for those old versions.
  • Loading branch information...
1 parent 29d5e81 commit 090a5f635d8061d5cda0c6e3f99dd4fab7e10094 @stronk7 stronk7 committed Sep 6, 2013
Showing with 6 additions and 0 deletions.
  1. +2 −0 lib/simplepie/readme_moodle.txt
  2. +4 −0 lib/simplepie/simplepie.class.php
@@ -5,6 +5,8 @@ Obtained from http://github.com/simplepie/simplepie/commit/798f4674468316b8cc70f
Changes:
* None. This import contains _NO_CHANGES_ to the simplepie.inc file, changes are
controlled through OO extension of the classes instead.
+ * Exception: The Sanitizer has been modified to return valid URLs. The change
+ is done through OO extension in 25 and upwards but not in 23 and 24.
Dan Poltawski <talktodan@gmail.com>
Petr Skoda
@@ -14466,6 +14466,10 @@ public function sanitize($data, $type, $base = '')
if ($type & SIMPLEPIE_CONSTRUCT_IRI)
{
$data = SimplePie_Misc::absolutize_url($data, $base);
+ // Moodle modification - Only return valid URLs. Note this change is interim and
+ // 2.5 and upwards have the cleaning performed in our own sanitizer.
+ $data = clean_param($data, PARAM_URL);
+ // End of Moodle modification.
}
if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI))

0 comments on commit 090a5f6

Please sign in to comment.