HEX
Server: Apache
System: Linux uyu7574470001-7d78c9ff74-xfpwm 4.19.91-21.al7.x86_64 #1 SMP Wed Sep 2 19:47:49 CST 2020 x86_64
User: ()
PHP: 7.4.16
Disabled: chmod,exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,socket_create_listen,socket_create_pair,socket_create,socket_get_option,socket_getpeername,socket_getsockname,socket_last_error,socket_listen,socket_read,socket_recv,socket_recvfrom,socket_select,socket_send,socket_sendto,socket_set_block,socket_set_nonblock,socket_set_option,socket_shutdown,socket_strerror,socket_write,stream_socket_client,stream_socket_server,pfsockopen,disk_total_space,disk_free_space,chown,diskfreespace,getrusage,get_current_user,getmyuid,getmypid,dl,leak,listen,chgrp,link,symlink,dlopen,proc_nice,proc_get_stats,proc_terminate,shell_exec,sh2_exec,posix_getpwuid,posix_getgrgid,posix_kill,ini_restore,mkfifo,dbmopen,dbase_open,filepro,filepro_rowcount,posix_mkfifo,putenv,sleep,fsockopen
Upload Files
File: /usr/home/uyu7574470001/htdocs/wp-content/plugins/duplicator/classes/utilities/class.u.patch.php
<?php

defined('ABSPATH') || defined('DUPXABSPATH') || exit;

/**
 * Class used to apply various patches to installer file
 *
 * Standard: PSR-2
 *
 * @link http://www.php-fig.org/psr/psr-2
 *
 * @package    Duplicator
 * @subpackage classes
 * @copyright  (c) 2022, Snapcreek LLC
 */
class DUP_Patch
{
    /**
    * The current backup directory path for Duplicator Lite
    * Possible options are 'wp-snapshots' and 'backups-dup-lite'
    */
    public $DupLiteBackupDir;

   /**
    * Class construct for init
    */
    public function __construct()
    {
        $this->DupLiteBackupDir = DUP_Settings::getSsdirPath();
    }

    /**
    * Apply patch code to all installer files
    */
    public function ApplyInstallerPatch_0001()
    {
        $backupDir = $this->DupLiteBackupDir;

        foreach (glob("{$backupDir}/*_installer.php") as $file) {
            if (strstr($file, '_installer.php')) {
                $content  = "<?php \n";
                $content .= "    /** PATCH_MARKER_START:V.0001 **/ \n";
                $content .= "    //TODO ADD PHP CODE HERE";
                $content .= "    /** PATCH_MARKER_END **/ \n";
                $content .= "?>\n";
                $this->fwritePrepend($file, $content);
            }
        }
    }


    /**
    * Prepends data to an existing file
    *
    * @param string $file      The full file path to the file
    * @param string $content    The content to prepend to the file
    *
    * @return TRUE on success or if file does not exist. FALSE on failure
    */
    private function fwritePrepend($file, $prepend)
    {
        if (!file_exists($file) || !is_writable($file)) {
            return false;
        }

        $handle    = fopen($file, "r+");
        $len       = strlen($prepend);
        $final_len = filesize($file) + $len;
        $cache_old = fread($handle, $len);
        rewind($handle);
        $i = 1;
        while (ftell($handle) < $final_len) {
            fwrite($handle, $prepend);
            $prepend   = $cache_old;
            $cache_old = fread($handle, $len);
            fseek($handle, $i * $len);
            $i++;
        }
    }
}