Plugin Directory

Changeset 1008052


Ignore:
Timestamp:
10/15/2014 06:31:43 PM (11 years ago)
Author:
outself
Message:

no destruct remove, simple rename malware files with random prefix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asgard/trunk/asgard.php

    r1008022 r1008052  
    5959            continue;
    6060        }
    61         if ( unlink( $path ) ) {
     61       
     62        // append random number prefix
     63        $backup_path = dirname($path) . DIRECTORY_SEPARATOR . mt_rand(0, 10000000) . basename($path);
     64        if ( rename( $path, $backup_path ) ) {
    6265            echo '<p class="text-success">' . $path . ' removed</p>';
    6366        }
     
    227230
    228231        $('.remove-malware').live('click', function(){
    229         if (!confirm('DANGER! This action completely remove files WITHOUT backup. Use at own RISK.')) return;
     232        if (!confirm('DANGER! This action completely remove files and backup it with random prefix. Use at own RISK.')) return;
    230233                var files = $('.mw-file').map(function(){ return $(this).data('path'); }).get();
    231234                $.post(ajaxurl, {action: 'asgard_remove_malware', files: files, security: '<?php
Note: See TracChangeset for help on using the changeset viewer.