diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-04 20:08:20 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-04 20:08:20 +0000 |
commit | 0630ba0a2b8033d7b0f5953aac6344eee752ba04 (patch) | |
tree | 10750b342afc46699f3658f2d952b97e309e9477 /engine/lib | |
parent | c9f0d56c2ee4a091a8424bb14a179fa58ddea2c0 (diff) | |
download | elgg-0630ba0a2b8033d7b0f5953aac6344eee752ba04.tar.gz elgg-0630ba0a2b8033d7b0f5953aac6344eee752ba04.tar.bz2 |
Fixes #2463: Added ^ to beginning of normalize_url regex to prevent matching on urls like mod/plugin/page.php. Added unit tests to verify functionality.
git-svn-id: http://code.elgg.org/elgg/trunk@7236 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/output.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engine/lib/output.php b/engine/lib/output.php index 84b012631..cac7eeb5b 100644 --- a/engine/lib/output.php +++ b/engine/lib/output.php @@ -161,11 +161,11 @@ function elgg_normalize_url($url) { } // 'example.com', 'example.com/subpage' - elseif (preg_match("#[^/]*\.[^/]*/?#i", $url)) { + elseif (preg_match("#^[^/]*\.#i", $url)) { return "http://$url"; } - // 'pg/page/handler' + // 'pg/page/handler', 'mod/plugin/file.php' else { return elgg_get_site_url().$url; } |