From 1f7940711d6fc9bdbbbd75873af1ce13cbfcc8ed Mon Sep 17 00:00:00 2001 From: Xaekai Date: Wed, 18 Feb 2015 18:39:40 -0800 Subject: [PATCH 1/2] Resolve missing closing parenthesis on the generic matcher. --- www/js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/util.js b/www/js/util.js index 95afc6ca..f8b96804 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -1331,7 +1331,7 @@ function parseMediaLink(url) { }; } // Generic for the rest. - if ((m = url.match(/([a-z]{2}):([^\?&#]+)/)) { + if ((m = url.match(/([a-z]{2}):([^\?&#]+)/))) { return { id: m[2], type: m[1] From 1c263f825b16847373c8bd333fb0a6c1e552c2d9 Mon Sep 17 00:00:00 2001 From: Xaekai Date: Sat, 21 Feb 2015 12:26:03 -0800 Subject: [PATCH 2/2] Add line start anchors to the shorthand URI parsers --- www/js/util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/js/util.js b/www/js/util.js index f8b96804..4d805e7e 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -1317,21 +1317,21 @@ function parseMediaLink(url) { /* Shorthand URIs */ // To catch Google Plus by ID alone - if ((m = url.match(/(?:gp:)?(\d{21}_\d{19}_\d{19})/))) { + if ((m = url.match(/^(?:gp:)?(\d{21}_\d{19}_\d{19})/))) { return { id: m[1], type: "gp" }; } // So we still trim DailyMotion URLs - if((m = url.match(/dm:([^\?&#_]+)/))) { + if((m = url.match(/^dm:([^\?&#_]+)/))) { return { id: m[1], type: "dm" }; } // Generic for the rest. - if ((m = url.match(/([a-z]{2}):([^\?&#]+)/))) { + if ((m = url.match(/^([a-z]{2}):([^\?&#]+)/))) { return { id: m[2], type: m[1]