From 24786872cdee97470016998ff170c99b00054167 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 6 Dec 2011 22:05:48 -0500 Subject: Fixes #4173 removed use of \w since it is locale sensitive --- engine/lib/output.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engine/lib/output.php') diff --git a/engine/lib/output.php b/engine/lib/output.php index 60bcc72cd..989eca60e 100644 --- a/engine/lib/output.php +++ b/engine/lib/output.php @@ -306,6 +306,9 @@ function elgg_get_friendly_title($title) { } //$title = iconv('UTF-8', 'ASCII//TRANSLIT', $title); + + // use A-Za-z0-9_ instead of \w because \w is locale sensitive + $title = preg_replace("/[^A-Za-z0-9_ ]/", "", $title); $title = preg_replace("/[^\w ]/", "", $title); $title = str_replace(" ", "-", $title); $title = str_replace("--", "-", $title); -- cgit v1.2.3 From c529671a522dea0dcfc280815092ee1f5127b92b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 17 Dec 2011 08:43:49 -0500 Subject: Fixes #4190 accepting full urls with non-ascii characters --- engine/lib/output.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engine/lib/output.php') diff --git a/engine/lib/output.php b/engine/lib/output.php index 989eca60e..6554481f5 100644 --- a/engine/lib/output.php +++ b/engine/lib/output.php @@ -234,7 +234,7 @@ function elgg_clean_vars(array $vars = array()) { * * @example * elgg_normalize_url(''); // 'http://my.site.com/' - * elgg_normalize_url('dashboard'); // 'http://my.site.com/dashboard' + * elgg_normalize_url('dashboard'); // 'http://my.site.com/dashboard' * elgg_normalize_url('http://google.com/'); // no change * elgg_normalize_url('//google.com/'); // no change * @@ -257,6 +257,11 @@ function elgg_normalize_url($url) { $validated = filter_var($url, FILTER_VALIDATE_URL); } + // work around for handling absoluate IRIs (RFC 3987) - see #4190 + if (!$validated && (strpos($url, 'http:') === 0) || (strpos($url, 'https:') === 0)) { + $validated = true; + } + if ($validated) { // all normal URLs including mailto: return $url; -- cgit v1.2.3