Duplicator - Bootloader |
version: » dup-installer-bootlog__[HASH].txt |
setHTTPHeaders(); $this->targetRoot = self::setSafePath(dirname(__FILE__)); $this->log('', true); $archive_filepath = $this->getArchiveFilePath(); $this->origDupInstFolder = self::INSTALLER_DIR_NAME; $this->targetDupInstFolder = filter_input(INPUT_GET, 'dup_folder', FILTER_SANITIZE_SPECIAL_CHARS, array( "options" => array( "default" => self::INSTALLER_DIR_NAME, ), 'flags' => FILTER_FLAG_STRIP_HIGH)); $this->isCustomDupFolder = $this->origDupInstFolder !== $this->targetDupInstFolder; $this->targetDupInst = $this->targetRoot . '/' . $this->targetDupInstFolder; $this->manualExtractFileName = 'dup-manual-extract__' . self::PACKAGE_HASH; if ($this->isCustomDupFolder) { $this->extractionTmpFolder = $this->getTempDir($this->targetRoot); } else { $this->extractionTmpFolder = $this->targetRoot; } DUPX_CSRF::init($this->targetDupInst, self::PACKAGE_HASH); $archiveActualSize = @file_exists($archive_filepath) ? @filesize($archive_filepath) : false; $archiveActualSize = ($archiveActualSize !== false) ? $archiveActualSize : 0; $this->hasZipArchive = class_exists('ZipArchive'); $this->hasShellExecUnzip = $this->getUnzipFilePath() != null ? true : false; $this->archiveExpectedSize = strlen(self::ARCHIVE_SIZE) ? self::ARCHIVE_SIZE : 0; $this->archiveActualSize = $archiveActualSize; if ($this->archiveExpectedSize > 0) { $this->archiveRatio = (((1.0) * $this->archiveActualSize) / $this->archiveExpectedSize) * 100; } else { $this->archiveRatio = 100; } } public static function getInstance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; } private function setHTTPHeaders() { header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); } private function getTempDir($path) { $tempfile = tempnam($path, 'dup-installer_tmp_'); if (file_exists($tempfile)) { unlink($tempfile); mkdir($tempfile); if (is_dir($tempfile)) { return $tempfile; } } return false; } public static function phpVersionCheck() { if (version_compare(PHP_VERSION, self::MINIMUM_PHP_VERSION, '>=')) { return true; } $match = null; if (preg_match("#^\d+(\.\d+)*#", PHP_VERSION, $match)) { $phpVersion = $match[0]; } else { $phpVersion = PHP_VERSION; } ?>
This server is running PHP: . A minimum of PHP
is required.
Contact your hosting provider or server administrator and let them know you would like to upgrade your PHP version.
' . htmlspecialchars($log_message) . ''); break; case E_NOTICE: case E_WARNING: default: $log_message = self::getMessage($errno, $errstr, $errfile, $errline); DUPX_Bootstrap::getInstance()->log($log_message); break; } } private static function getMessage($errno, $errstr, $errfile, $errline) { $result = '[PHP ERR]'; switch ($errno) { case E_ERROR: $result .= '[FATAL]'; break; case E_WARNING: $result .= '[WARN]'; break; case E_NOTICE: $result .= '[NOTICE]'; break; default: $result .= '[ISSUE]'; break; } $result .= ' MSG:'; $result .= $errstr; $result .= ' [CODE:' . $errno . '|FILE:' . $errfile . '|LINE:' . $errline . ']'; return $result; } public static function shutdown() { if (($error = error_get_last())) { LogHandler::error($error['type'], $error['message'], $error['file'], $error['line']); } } } class DUPX_CSRF { private static $packagHash = null; private static $mainFolder = null; public static $prefix = '_DUPX_CSRF'; private static $CSRFVars = null; public static function init($mainFolderm, $packageHash) { self::$mainFolder = $mainFolderm; self::$packagHash = $packageHash; self::$CSRFVars = null; } public static function setKeyVal($key, $val) { $CSRFVars = self::getCSRFVars(); $CSRFVars[$key] = $val; self::saveCSRFVars($CSRFVars); self::$CSRFVars = null; } public static function getVal($key) { $CSRFVars = self::getCSRFVars(); if (isset($CSRFVars[$key])) { return $CSRFVars[$key]; } else { return false; } } public static function generate($form = null) { $keyName = self::getKeyName($form); $existingToken = self::getVal($keyName); if (false !== $existingToken) { $token = $existingToken; } else { $token = DUPX_CSRF::token() . DUPX_CSRF::fingerprint(); } self::setKeyVal($keyName, $token); return $token; } public static function check($token, $form = null) { if (empty($form)) { return false; } $keyName = self::getKeyName($form); $CSRFVars = self::getCSRFVars(); if (isset($CSRFVars[$keyName]) && $CSRFVars[$keyName] == $token) { // token OK return true; } return false; } protected static function token() { $microtime = (int) (microtime(true) * 10000); mt_srand($microtime); $charid = strtoupper(md5(uniqid(rand(), true))); return substr($charid, 0, 8) . substr($charid, 8, 4) . substr($charid, 12, 4) . substr($charid, 16, 4) . substr($charid, 20, 12); } protected static function fingerprint() { return strtoupper(md5(implode('|', array($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT'])))); } private static function getKeyName($form) { return DUPX_CSRF::$prefix . '_' . $form; } private static function getPackageHash() { if (is_null(self::$packagHash)) { throw new Exception('Not init CSFR CLASS'); } return self::$packagHash; } private static function getFilePath() { if (is_null(self::$mainFolder)) { throw new Exception('Not init CSFR CLASS'); } $dupInstallerfolderPath = self::$mainFolder; $packageHash = self::getPackageHash(); $fileName = 'dup-installer-csrf__' . $packageHash . '.txt'; $filePath = $dupInstallerfolderPath . '/' . $fileName; return $filePath; } private static function getCSRFVars() { if (is_null(self::$CSRFVars)) { $filePath = self::getFilePath(); if (file_exists($filePath)) { $contents = file_get_contents($filePath); if (empty($contents)) { self::$CSRFVars = array(); } else { $CSRFobjs = json_decode($contents); foreach ($CSRFobjs as $key => $value) { self::$CSRFVars[$key] = $value; } } } else { self::$CSRFVars = array(); } } return self::$CSRFVars; } private static function saveCSRFVars($CSRFVars) { $contents = json_encode($CSRFVars); $filePath = self::getFilePath(); file_put_contents($filePath, $contents); } } $auto_refresh = isset($_POST['auto-fresh']) ? true : false; DUPX_Bootstrap::phpVersionCheck(); try { $boot = DUPX_Bootstrap::getInstance(); $boot_error = $boot->run(); } catch (Exception $e) { $boot_error = $e->getMessage(); } if ($boot_error == null) { $secure_csrf_token = DUPX_CSRF::generate('secure'); $ctrl_csrf_token = DUPX_CSRF::generate('ctrl-step1'); DUPX_CSRF::setKeyVal('installerOrigCall', DUPX_Bootstrap::getCurrentUrl()); DUPX_CSRF::setKeyVal('installerOrigPath', __FILE__); DUPX_CSRF::setKeyVal('archive', $boot->archive); DUPX_CSRF::setKeyVal('bootloader', $boot->bootloader); DUPX_CSRF::setKeyVal('booturl', '//' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); DUPX_CSRF::setKeyVal('bootLogFile', $boot->getBootLogFilePath()); DUPX_CSRF::setKeyVal('package_hash', DUPX_Bootstrap::PACKAGE_HASH); DUPX_CSRF::setKeyVal('secondaryHash', DUPX_Bootstrap::SECONDARY_PACKAGE_HASH); } ?>
Duplicator - Bootloader |
version: » dup-installer-bootlog__[HASH].txt |