From cb27322b1421bd4cb2ce1889c38da5c8666d68f2 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Mon, 9 Apr 2012 17:07:29 -0400 Subject: fix for users who paste from Chrome's address bar (sometimes leaves off URL scheme) --- lib/videolist.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/videolist.php b/lib/videolist.php index 93b27b51c..776ce7093 100644 --- a/lib/videolist.php +++ b/lib/videolist.php @@ -29,6 +29,10 @@ function videolist_get_default_platforms() { */ function videolist_parse_url($url) { $parsed = parse_url($url); + if (empty($parsed['host']) && ! empty($parsed['path']) && $parsed['path'][0] !== '/') { + // user probably forgot scheme + $url = 'http://' . $url; + } $params['url'] = $url; $platforms = videolist_get_default_platforms(); $platforms = elgg_trigger_plugin_hook('videolist:prepare', 'platforms', $params, $platforms); -- cgit v1.2.3