Fix replaced CSRF token for shuffle radio

For convenience, shuffle radio filters were saved and restored when
loading the `more.view` page. This also happened for the `_csrf` field,
which caused it to take an old and invalid value.
master
François-Xavier Thomas 8 years ago
parent 1f1ec26634
commit 4316292ce7
No known key found for this signature in database
GPG Key ID: 64337406D2DD45CE
  1. 13
      libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp

@ -62,6 +62,7 @@
} catch(e) { return; } } catch(e) { return; }
elements = form.getElementsByTagName("input"); elements = form.getElementsByTagName("input");
for (var i = 0; i < elements.length; i++) { for (var i = 0; i < elements.length; i++) {
if (elements[i].type == "hidden") continue;
if (elements[i].type == "submit") continue; if (elements[i].type == "submit") continue;
if (data[elements[i].name]) elements[i].value = data[elements[i].name]; if (data[elements[i].name]) elements[i].value = data[elements[i].name];
} }
@ -87,9 +88,17 @@
var data = {} var data = {}
var elements = []; var elements = [];
elements = form.getElementsByTagName("input"); elements = form.getElementsByTagName("input");
for (var i = 0; i < elements.length; i++) data[elements[i].name] = elements[i].value; for (var i = 0; i < elements.length; i++) {
if (elements[i].type == "hidden") continue;
if (elements[i].type == "submit") continue;
data[elements[i].name] = elements[i].value;
}
elements = form.getElementsByTagName("select"); elements = form.getElementsByTagName("select");
for (var i = 0; i < elements.length; i++) data[elements[i].name] = elements[i].value; for (var i = 0; i < elements.length; i++) {
if (elements[i].type == "hidden") continue;
if (elements[i].type == "submit") continue;
data[elements[i].name] = elements[i].value;
}
localStorage.setItem("randomPlayQueue", JSON.stringify(data)); localStorage.setItem("randomPlayQueue", JSON.stringify(data));
} }

Loading…
Cancel
Save