HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux sa-dev.otherchirps.net 5.15.0-139-generic #149-Ubuntu SMP Fri Apr 11 22:06:13 UTC 2025 x86_64
User: www-data (33)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wp-content/plugins/updraftplus/includes/class-updraftcentral-updraftplus-commands.php
<?php
if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed');

/*
This is a small glue class, which makes available all the commands in UpdraftPlus_Commands, and translates the response from UpdraftPlus_Commands (which is either data to return, or a WP_Error) into the format used by UpdraftCentral.
*/

if (class_exists('UpdraftCentral_UpdraftPlus_Commands')) return;

class UpdraftCentral_UpdraftPlus_Commands extends UpdraftCentral_Commands {

	private $commands;

	public function __construct($rc) {
	
		parent::__construct($rc);
	
		if (!class_exists('UpdraftPlus_Commands')) updraft_try_include_file('includes/class-commands.php', 'include_once');
		$this->commands = new UpdraftPlus_Commands($this);
		
	}

	public function __call($name, $arguments) {
	
		if ('_' == substr($name, 0, 1) || !method_exists($this->commands, $name)) return $this->_generic_error_response('unknown_rpc_command', array(
			'prefix' => 'updraftplus',
			'command' => $name,
			'class' => 'UpdraftCentral_UpdraftPlus_Commands'
		));
	
		$result = call_user_func_array(array($this->commands, $name), $arguments);
		
		if (is_wp_error($result)) {
		
			return $this->_generic_error_response($result->get_error_code(), $result->get_error_data());
		
		} else {
		
			return $this->_response($result);
		
		}
		
	}
	
	public function _updraftplus_background_operation_started($msg) {

		// Under-the-hood hackery to allow the browser connection to be closed, and the backup/download to continue
		
		$rpc_response = $this->rc->return_rpc_message($this->_response($msg));
		
		$data = isset($rpc_response['data']) ? $rpc_response['data'] : null;

		$ud_rpc = $this->rc->get_current_udrpc();
		
		$encoded = json_encode($ud_rpc->create_message($rpc_response['response'], $data, true));
		
		global $updraftplus;
		$updraftplus->close_browser_connection($encoded);

	}
}