From d051fc17ff21a5bbe40721d580da92c2ec6524af Mon Sep 17 00:00:00 2001 From: Gunnar Lium Date: Tue, 20 Nov 2012 09:53:27 +0100 Subject: [PATCH] Escape `.`-character for proper matching. Current regex, raw_data.match(".jsonp") would match any string that contains "jsonp" with at least one preceding character, as . is treated as a wild card. Escaping the . makes sure we only match the actual string ".jsonp". --- source/js/VMM.Timeline.DataObj.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/js/VMM.Timeline.DataObj.js b/source/js/VMM.Timeline.DataObj.js index d5dd9de..4605773 100644 --- a/source/js/VMM.Timeline.DataObj.js +++ b/source/js/VMM.Timeline.DataObj.js @@ -22,7 +22,7 @@ if (typeof VMM.Timeline !== 'undefined' && typeof VMM.Timeline.DataObj == 'undef trace("DATA SOURCE: STORIFY"); VMM.Timeline.DataObj.model.storify.getData(raw_data); //http://api.storify.com/v1/stories/number10gov/g8-and-nato-chicago-summit - } else if (raw_data.match(".jsonp")) { + } else if (raw_data.match("\.jsonp")) { trace("DATA SOURCE: JSONP"); LoadLib.js(raw_data, VMM.Timeline.DataObj.onJSONPLoaded); } else {