ady624 / webCoRE

webCoRE is a web version of CoRE
GNU General Public License v3.0
251 stars 984 forks source link

Patchfor he1 #82

Closed imnotbob closed 5 years ago

imnotbob commented 5 years ago

Hopefully this works...

idpaterson commented 5 years ago

Cheers, this looks like a clean and complete changeset! Thanks for working through the various issues with git and line ending formats. I will review over the next few days then request some beta testing from ST users.

idpaterson commented 5 years ago

This looks good, will merge to dev later today to prepare for testing. I'm a bit concerned about using window.si in piston.module.js like this:

    $scope.getIFTTTUri = function(eventName) {
        var uri = dataService.getApiUri();
        if (!uri) return "An error has occurred retrieving the IFTTT Maker URL";
        return uri + 'ifttt/' + eventName + (si.accessToken ? '?access_token=' + si.accessToken : '');
    }

si comes from app.js and it appears to be unintended that it is exposed on window rather than just a local variable. It gets exposed by a few functions in app.js that are missing the var keyword when assigning to si:

    si = store ? store[inst.id] : null;

I don't see any other convenient way to get the value in the piston module and si does appear to be leaked in the minified production code as well so not a big deal.