Sanitize google drive IDs to remove URL hash etc.
This commit is contained in:
parent
46a738b7f4
commit
1797e11b43
|
@ -2,7 +2,7 @@
|
||||||
"author": "Calvin Montgomery",
|
"author": "Calvin Montgomery",
|
||||||
"name": "CyTube",
|
"name": "CyTube",
|
||||||
"description": "Online media synchronizer and chat",
|
"description": "Online media synchronizer and chat",
|
||||||
"version": "3.52.1",
|
"version": "3.52.2",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
|
@ -467,6 +467,11 @@ var Getters = {
|
||||||
|
|
||||||
/* google docs */
|
/* google docs */
|
||||||
gd: function (id, callback) {
|
gd: function (id, callback) {
|
||||||
|
if (!/^[a-zA-Z0-9_-]+$/.test(id)) {
|
||||||
|
callback("Invalid ID: " + id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
type: "googledrive",
|
type: "googledrive",
|
||||||
kind: "single",
|
kind: "single",
|
||||||
|
|
|
@ -1368,8 +1368,8 @@ function parseMediaLink(url) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m = url.match(/(?:docs|drive)\.google\.com\/file\/d\/([^\/]*)/)) ||
|
if ((m = url.match(/(?:docs|drive)\.google\.com\/file\/d\/([a-zA-Z0-9_-]+)/)) ||
|
||||||
(m = url.match(/drive\.google\.com\/open\?id=([^&]*)/))) {
|
(m = url.match(/drive\.google\.com\/open\?id=([a-zA-Z0-9_-]+)/))) {
|
||||||
return {
|
return {
|
||||||
id: m[1],
|
id: m[1],
|
||||||
type: "gd"
|
type: "gd"
|
||||||
|
|
Loading…
Reference in a new issue