File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -347,13 +347,14 @@ public function addItem(MenuAdmin $menu)
347347 </div>
348348</div>
349349<script>
350+ var adminSaveToken = '<?php echo getToken (); ?> ';
350351 $(document).ready(function() {
351352 $('.adminOptionsForm').submit(function(e) {
352353 e.preventDefault();
353354 modal.showPleaseWait();
354355 $.ajax({
355356 url: webSiteRootURL + 'admin/save.json.php',
356- data: $(this).serialize(),
357+ data: $(this).serialize() + '&globalToken=' + encodeURIComponent(adminSaveToken) ,
357358 type: 'post',
358359 success: function(response) {
359360 modal.hidePleaseWait();
Original file line number Diff line number Diff line change 88if (!User::isAdmin ()) {
99 die ('{"error":" ' . __ ("Permission denied " ) . '"} ' );
1010}
11+ if (!isGlobalTokenValid ()) {
12+ die ('{"error":" ' . __ ("Invalid or missing CSRF token " ) . '"} ' );
13+ }
1114
1215$ pluginName = $ _POST ['pluginName ' ];
1316
You can’t perform that action at this time.
0 commit comments