MDL-30595 workaround for PHP5.2 preg_quote trouble

This commit is contained in:
Petr Skoda
2011-12-06 14:11:16 +01:00
parent 4828564296
commit 88ec670c50
+1 -1
View File
@@ -91,7 +91,7 @@ function url_get_full_url($url, $cm, $course, $config=null) {
if (preg_match('/^(\/|https?:|ftp:)/i', $fullurl) or preg_match('|^/|', $fullurl)) {
// encode extra chars in URLs - this does not make it always valid, but it helps with some UTF-8 problems
$allowed = "a-zA-Z0-9".preg_quote(';/?:@=&$_.+!*(),-#%', '/');
$allowed = "a-zA-Z0-9".preg_quote(';/?:@=&$_.+!*(),#%-', '/');
$fullurl = preg_replace_callback("/[^$allowed]/", 'url_filter_callback', $fullurl);
} else {
// encode special chars only