Skip to content

Commit

Permalink
fix: (esx_context) unsafe dynamic method access
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Sep 21, 2024
1 parent 339a173 commit d0eb6f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions server-data/resources/[esx]/esx_context/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,20 @@
});
}

const api = {
Open,
Closed,
Close
};

window.addEventListener("message", (e) => {
let data = e.data;

if (!data.func || !window[data.func]) {
if (!data.func || !api.hasOwnProperty(data.func)) {
return;
}

window[data.func](...data.args);
api[data.func](...data.args);
});

window.addEventListener("keydown", (e) => {
Expand Down

0 comments on commit d0eb6f2

Please sign in to comment.