1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 08:34:20 +02:00

Use JSON.parse if available

This commit is contained in:
Jakub Vrana
2018-01-09 18:16:02 +01:00
parent e614ae08c4
commit 3408d4ad78
2 changed files with 2 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ function page_headers() {
header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page
header("X-Content-Type-Options: nosniff");
header("Referrer-Policy: origin-when-cross-origin");
header("Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self'; frame-src https://www.adminer.org; form-action 'self'");
header("Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self'; frame-src https://www.adminer.org; form-action 'self'");
$adminer->headers();
}

View File

@@ -565,7 +565,7 @@ function ajax(url, callback, data, message) {
*/
function ajaxSetHtml(url) {
return ajax(url, function (request) {
var data = eval('(' + request.responseText + ')');
var data = window.JSON ? JSON.parse(request.responseText) : eval('(' + request.responseText + ')');
for (var key in data) {
setHtml(key, data[key]);
}