Skip to content
Snippets Groups Projects
Commit f7b6e27e authored by Michael Hamann's avatar Michael Hamann
Browse files

Remove the security token from the ajax draft/lock calls again

The security token here doesn't improve the security as the other
requests that allow you to do the same thing aren't protected and I
don't see why locking or draft creation should be subject of XSRF
attacks.
parent 5db16396
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,6 @@ function ajax_lock(){
$ID = cleanID($_POST['id']);
if(empty($ID)) return;
if (!checkSecurityToken()) return;
$INFO = pageinfo();
......@@ -169,7 +168,6 @@ function ajax_lock(){
function ajax_draftdel(){
$id = cleanID($_REQUEST['id']);
if(empty($id)) return;
if (!checkSecurityToken()) return;
$client = $_SERVER['REMOTE_USER'];
if(!$client) $client = clientIP(true);
......
......@@ -275,7 +275,6 @@ function deleteDraft() {
if(dwform){
var params = 'call=draftdel';
params += '&id='+encodeURIComponent(dwform.elements.id.value);
params += '&sectok='+encodeURIComponent(dwform.elements.sectok.value);
var sackobj = new sack(DOKU_BASE + 'lib/exe/ajax.php');
// this needs to be synchronous and GET to not be aborted upon page unload
......
......@@ -73,7 +73,6 @@ var locktimer = {
if(now.getTime() - locktimer.lasttime.getTime() > 30*1000){
var params = 'call=lock&id='+encodeURIComponent(locktimer.pageid);
var dwform = $('dw__editform');
params += '&sectok='+encodeURIComponent(dwform.elements.sectok.value);
if(locktimer.draft && dwform.elements.wikitext){
params += '&prefix='+encodeURIComponent(dwform.elements.prefix.value);
params += '&wikitext='+encodeURIComponent(dwform.elements.wikitext.value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment