diff --git a/package.json b/package.json index 6194bf28..d4e22b11 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.52.1", + "version": "3.52.2", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/src/get-info.js b/src/get-info.js index f104fb03..642c4a19 100644 --- a/src/get-info.js +++ b/src/get-info.js @@ -467,6 +467,11 @@ var Getters = { /* google docs */ gd: function (id, callback) { + if (!/^[a-zA-Z0-9_-]+$/.test(id)) { + callback("Invalid ID: " + id); + return; + } + var data = { type: "googledrive", kind: "single", diff --git a/www/js/util.js b/www/js/util.js index 36c2d353..76cd7e9f 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -1368,8 +1368,8 @@ function parseMediaLink(url) { }; } - if ((m = url.match(/(?:docs|drive)\.google\.com\/file\/d\/([^\/]*)/)) || - (m = url.match(/drive\.google\.com\/open\?id=([^&]*)/))) { + if ((m = url.match(/(?:docs|drive)\.google\.com\/file\/d\/([a-zA-Z0-9_-]+)/)) || + (m = url.match(/drive\.google\.com\/open\?id=([a-zA-Z0-9_-]+)/))) { return { id: m[1], type: "gd"