Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 0684b13

Browse files
Remove usage of setTimeout eval. Fixes #14172
1 parent e501f67 commit 0684b13

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/code/Magento/Integration/Controller/Adminhtml/Integration/LoginSuccessCallback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class LoginSuccessCallback extends \Magento\Integration\Controller\Adminhtml\Int
1515
*/
1616
public function execute()
1717
{
18-
$this->getResponse()->setBody('<script>setTimeout("self.close()",1000);</script>');
18+
$this->getResponse()->setBody('<script>setTimeout(self.close.bind(this), 1000);</script>');
1919
}
2020
}

app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ define([
1919
window.onRequestAnimationFrame ||
2020
window.msRequestAnimationFrame ||
2121
function (callback) {
22+
if (typeof callback != 'function') {
23+
throw new Error('raf argument "callback" must be of type function');
24+
}
2225
window.setTimeout(callback, 1000 / 60);
2326
};
2427

0 commit comments

Comments
 (0)