aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/Ajax.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/Ajax.php')
-rw-r--r--inc/Ajax.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/inc/Ajax.php b/inc/Ajax.php
index f1aea7d93..76d9dd5fb 100644
--- a/inc/Ajax.php
+++ b/inc/Ajax.php
@@ -168,8 +168,10 @@ class Ajax {
$client = $_SERVER['REMOTE_USER'];
if(!$client) $client = clientIP(true);
- $cname = getCacheName($client . $id, '.draft');
- @unlink($cname);
+ $draft = new Draft($id, $client);
+ if ($draft->isDraftAvailable() && checkSecurityToken()) {
+ $draft->deleteDraft();
+ }
}
/**
@@ -241,14 +243,11 @@ class Ajax {
* @author Kate Arzamastseva <pshns@ukr.net>
*/
protected function callMediadiff() {
- global $NS;
global $INPUT;
$image = '';
if($INPUT->has('image')) $image = cleanID($INPUT->str('image'));
- $NS = getNS($image);
- $auth = auth_quickaclcheck("$NS:*");
- media_diff($image, $NS, $auth, true);
+ (new Ui\MediaDiff($image))->preference('fromAjax', true)->show();
}
/**