Edit File by line
/home/barbar84/www/wp-conte.../plugins/updraftp.../central/modules
File: core.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (!defined('UPDRAFTCENTRAL_CLIENT_DIR')) die('No access.');
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* - A container for RPC commands (core UpdraftCentral commands). Commands map exactly onto method names (and hence this class should not implement anything else, beyond the constructor, and private methods)
[5] Fix | Delete
* - Return format is array('response' => (string - a code), 'data' => (mixed));
[6] Fix | Delete
*
[7] Fix | Delete
* RPC commands are not allowed to begin with an underscore. So, any private methods can be prefixed with an underscore.
[8] Fix | Delete
*/
[9] Fix | Delete
class UpdraftCentral_Core_Commands extends UpdraftCentral_Commands {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Executes a list of submitted commands (multiplexer)
[13] Fix | Delete
*
[14] Fix | Delete
* @param Array $query An array containing the commands to execute and a flag to indicate how to handle command execution failure.
[15] Fix | Delete
* @return Array An array containing the results of the process.
[16] Fix | Delete
*/
[17] Fix | Delete
public function execute_commands($query) {
[18] Fix | Delete
[19] Fix | Delete
try {
[20] Fix | Delete
[21] Fix | Delete
$commands = $query['commands'];
[22] Fix | Delete
$command_results = array();
[23] Fix | Delete
$error_count = 0;
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* Should be one of the following options:
[27] Fix | Delete
* 1 = Abort on first failure
[28] Fix | Delete
* 2 = Abort if any command fails
[29] Fix | Delete
* 3 = Abort if all command fails (default)
[30] Fix | Delete
*/
[31] Fix | Delete
$error_flag = isset($query['error_flag']) ? (int) $query['error_flag'] : 3;
[32] Fix | Delete
[33] Fix | Delete
[34] Fix | Delete
foreach ($commands as $command => $params) {
[35] Fix | Delete
$command_info = apply_filters('updraftcentral_get_command_info', false, $command);
[36] Fix | Delete
if (!$command_info) {
[37] Fix | Delete
list($_prefix, $_command) = explode('.', $command);
[38] Fix | Delete
$command_results[$_prefix][$_command] = array('response' => 'rpcerror', 'data' => array('code' => 'unknown_rpc_command', 'data' => $command));
[39] Fix | Delete
[40] Fix | Delete
$error_count++;
[41] Fix | Delete
if (1 === $error_flag) break;
[42] Fix | Delete
} else {
[43] Fix | Delete
[44] Fix | Delete
$action = $command_info['command'];
[45] Fix | Delete
$command_php_class = $command_info['command_php_class'];
[46] Fix | Delete
[47] Fix | Delete
// Instantiate the command class and execute the needed action
[48] Fix | Delete
if (class_exists($command_php_class)) {
[49] Fix | Delete
$instance = new $command_php_class($this->rc);
[50] Fix | Delete
[51] Fix | Delete
if (method_exists($instance, $action)) {
[52] Fix | Delete
$params = empty($params) ? array() : $params;
[53] Fix | Delete
$call_result = call_user_func(array($instance, $action), $params);
[54] Fix | Delete
[55] Fix | Delete
$command_results[$command] = $call_result;
[56] Fix | Delete
if ('rpcerror' === $call_result['response'] || (isset($call_result['data']['error']) && $call_result['data']['error'])) {
[57] Fix | Delete
$error_count++;
[58] Fix | Delete
if (1 === $error_flag) break;
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
}
[62] Fix | Delete
}
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
if (0 !== $error_count) {
[66] Fix | Delete
// N.B. These error messages should be defined in UpdraftCentral's translation file (dashboard-translations.php)
[67] Fix | Delete
// before actually using this multiplexer function.
[68] Fix | Delete
$message = 'general_command_execution_error';
[69] Fix | Delete
[70] Fix | Delete
switch ($error_flag) {
[71] Fix | Delete
case 1:
[72] Fix | Delete
$message = 'command_execution_aborted';
[73] Fix | Delete
break;
[74] Fix | Delete
case 2:
[75] Fix | Delete
$message = 'failed_to_execute_some_commands';
[76] Fix | Delete
break;
[77] Fix | Delete
case 3:
[78] Fix | Delete
if (count($commands) === $error_count) {
[79] Fix | Delete
$message = 'failed_to_execute_all_commands';
[80] Fix | Delete
}
[81] Fix | Delete
break;
[82] Fix | Delete
default:
[83] Fix | Delete
break;
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
$result = array('error' => true, 'message' => $message, 'values' => $command_results);
[87] Fix | Delete
} else {
[88] Fix | Delete
$result = $command_results;
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
} catch (Exception $e) {
[92] Fix | Delete
$result = array('error' => true, 'message' => $e->getMessage());
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
return $this->_response($result);
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
/**
[99] Fix | Delete
* Validates the credentials entered by the user
[100] Fix | Delete
*
[101] Fix | Delete
* @param array $creds an array of filesystem credentials
[102] Fix | Delete
* @return array An array containing the result of the validation process.
[103] Fix | Delete
*/
[104] Fix | Delete
public function validate_credentials($creds) {
[105] Fix | Delete
[106] Fix | Delete
try {
[107] Fix | Delete
[108] Fix | Delete
$entity = $creds['entity'];
[109] Fix | Delete
if (isset($creds['filesystem_credentials'])) {
[110] Fix | Delete
parse_str($creds['filesystem_credentials'], $filesystem_credentials);
[111] Fix | Delete
if (is_array($filesystem_credentials)) {
[112] Fix | Delete
foreach ($filesystem_credentials as $key => $value) {
[113] Fix | Delete
// Put them into $_POST, which is where request_filesystem_credentials() checks for them.
[114] Fix | Delete
$_POST[$key] = $value;
[115] Fix | Delete
}
[116] Fix | Delete
}
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
// Include the needed WP Core file(s)
[120] Fix | Delete
// template.php needed for submit_button() which is called by request_filesystem_credentials()
[121] Fix | Delete
$this->_admin_include('file.php', 'template.php');
[122] Fix | Delete
[123] Fix | Delete
// Directory entities that we currently need permissions
[124] Fix | Delete
// to update.
[125] Fix | Delete
$entity_directories = array(
[126] Fix | Delete
'plugins' => WP_PLUGIN_DIR,
[127] Fix | Delete
'themes' => WP_CONTENT_DIR.'/themes',
[128] Fix | Delete
'core' => untrailingslashit(ABSPATH)
[129] Fix | Delete
);
[130] Fix | Delete
[131] Fix | Delete
if ('translations' === $entity) {
[132] Fix | Delete
// 'en_US' don't usually have the "languages" folder, thus, we
[133] Fix | Delete
// check if there's a need to ask for filesystem credentials for that
[134] Fix | Delete
// folder if it exists, most especially for locale other than 'en_US'.
[135] Fix | Delete
$language_dir = WP_CONTENT_DIR.'/languages';
[136] Fix | Delete
if ('en_US' !== get_locale() && is_dir($language_dir)) {
[137] Fix | Delete
$entity_directories['translations'] = $language_dir;
[138] Fix | Delete
}
[139] Fix | Delete
}
[140] Fix | Delete
[141] Fix | Delete
$url = wp_nonce_url(site_url());
[142] Fix | Delete
[143] Fix | Delete
$passed = false;
[144] Fix | Delete
if (isset($entity_directories[$entity])) {
[145] Fix | Delete
$directory = $entity_directories[$entity];
[146] Fix | Delete
[147] Fix | Delete
// Check if credentials are valid and have sufficient
[148] Fix | Delete
// privileges to create and delete (e.g. write)
[149] Fix | Delete
ob_start();
[150] Fix | Delete
$credentials = request_filesystem_credentials($url, '', false, $directory);
[151] Fix | Delete
ob_end_clean();
[152] Fix | Delete
[153] Fix | Delete
// The "WP_Filesystem" will suffice in validating the inputted credentials
[154] Fix | Delete
// from UpdraftCentral, as it is already attempting to connect to the filesystem
[155] Fix | Delete
// using the chosen transport (e.g. ssh, ftp, etc.)
[156] Fix | Delete
$passed = WP_Filesystem($credentials, $directory);
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
if ($passed) {
[160] Fix | Delete
$result = array('error' => false, 'message' => 'credentials_ok', 'values' => array());
[161] Fix | Delete
} else {
[162] Fix | Delete
// We're adding some useful error information to help troubleshooting any problems
[163] Fix | Delete
// that may arise in the future. If the user submitted a wrong password or username
[164] Fix | Delete
// it usually falls through here.
[165] Fix | Delete
global $wp_filesystem;
[166] Fix | Delete
[167] Fix | Delete
$errors = array();
[168] Fix | Delete
if (isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors)) {
[169] Fix | Delete
$errors = $wp_filesystem->errors->errors;
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
$result = array('error' => true, 'message' => 'failed_credentials', 'values' => array('errors' => $errors));
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
} catch (Exception $e) {
[176] Fix | Delete
$result = array('error' => true, 'message' => $e->getMessage(), 'values' => array());
[177] Fix | Delete
}
[178] Fix | Delete
[179] Fix | Delete
return $this->_response($result);
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
/**
[183] Fix | Delete
* Gets the FileSystem Credentials
[184] Fix | Delete
*
[185] Fix | Delete
* Extract the needed filesystem credentials (permissions) to be used
[186] Fix | Delete
* to update/upgrade the plugins, themes and the WP core.
[187] Fix | Delete
*
[188] Fix | Delete
* @return array $result - An array containing the creds form and some flags
[189] Fix | Delete
* to determine whether we need to extract the creds
[190] Fix | Delete
* manually from the user.
[191] Fix | Delete
*/
[192] Fix | Delete
public function get_credentials() {
[193] Fix | Delete
[194] Fix | Delete
try {
[195] Fix | Delete
[196] Fix | Delete
// Check whether user has enough permission to update entities
[197] Fix | Delete
if (!current_user_can('update_plugins') && !current_user_can('update_themes') && !current_user_can('update_core')) return $this->_generic_error_response('updates_permission_denied');
[198] Fix | Delete
[199] Fix | Delete
// Include the needed WP Core file(s)
[200] Fix | Delete
$this->_admin_include('file.php', 'template.php');
[201] Fix | Delete
[202] Fix | Delete
// A container that will hold the state (in this case, either true or false) of
[203] Fix | Delete
// each directory entities (plugins, themes, core) that will be used to determine
[204] Fix | Delete
// whether or not there's a need to show a form that will ask the user for their credentials
[205] Fix | Delete
// manually.
[206] Fix | Delete
$request_filesystem_credentials = array();
[207] Fix | Delete
[208] Fix | Delete
// A container for the filesystem credentials form if applicable.
[209] Fix | Delete
$filesystem_form = '';
[210] Fix | Delete
[211] Fix | Delete
// Directory entities that we currently need permissions
[212] Fix | Delete
// to update.
[213] Fix | Delete
$check_fs = array(
[214] Fix | Delete
'plugins' => WP_PLUGIN_DIR,
[215] Fix | Delete
'themes' => WP_CONTENT_DIR.'/themes',
[216] Fix | Delete
'core' => untrailingslashit(ABSPATH)
[217] Fix | Delete
);
[218] Fix | Delete
[219] Fix | Delete
// Here, we're looping through each entities and find output whether
[220] Fix | Delete
// we have sufficient permissions to update objects belonging to them.
[221] Fix | Delete
foreach ($check_fs as $entity => $dir) {
[222] Fix | Delete
[223] Fix | Delete
// We're determining which method to use when updating
[224] Fix | Delete
// the files in the filesystem.
[225] Fix | Delete
$filesystem_method = get_filesystem_method(array(), $dir);
[226] Fix | Delete
[227] Fix | Delete
// Buffering the output to pull the actual credentials form
[228] Fix | Delete
// currently being used by this WP instance if no sufficient permissions
[229] Fix | Delete
// is found.
[230] Fix | Delete
$url = wp_nonce_url(site_url());
[231] Fix | Delete
[232] Fix | Delete
ob_start();
[233] Fix | Delete
$filesystem_credentials_are_stored = request_filesystem_credentials($url, $filesystem_method);
[234] Fix | Delete
$form = strip_tags(ob_get_contents(), '<div><h2><p><input><label><fieldset><legend><span><em>');
[235] Fix | Delete
[236] Fix | Delete
if (!empty($form)) {
[237] Fix | Delete
$filesystem_form = $form;
[238] Fix | Delete
}
[239] Fix | Delete
ob_end_clean();
[240] Fix | Delete
[241] Fix | Delete
// Save the state whether or not there's a need to show the
[242] Fix | Delete
// credentials form to the user.
[243] Fix | Delete
$request_filesystem_credentials[$entity] = ('direct' !== $filesystem_method && !$filesystem_credentials_are_stored);
[244] Fix | Delete
}
[245] Fix | Delete
[246] Fix | Delete
// Wrapping the credentials info before passing it back
[247] Fix | Delete
// to the client issuing the request.
[248] Fix | Delete
$result = array(
[249] Fix | Delete
'request_filesystem_credentials' => $request_filesystem_credentials,
[250] Fix | Delete
'filesystem_form' => $filesystem_form
[251] Fix | Delete
);
[252] Fix | Delete
[253] Fix | Delete
} catch (Exception $e) {
[254] Fix | Delete
$result = array('error' => true, 'message' => $e->getMessage(), 'values' => array());
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
return $this->_response($result);
[258] Fix | Delete
}
[259] Fix | Delete
[260] Fix | Delete
/**
[261] Fix | Delete
* Fetches a browser-usable URL which will automatically log the user in to the site
[262] Fix | Delete
*
[263] Fix | Delete
* @param String $redirect_to - the URL to got to after logging in
[264] Fix | Delete
* @param Array $extra_info - valid keys are user_id, which should be a numeric user ID to log in as.
[265] Fix | Delete
*/
[266] Fix | Delete
public function get_login_url($redirect_to, $extra_info) {
[267] Fix | Delete
[268] Fix | Delete
if (is_array($extra_info) && !empty($extra_info['user_id']) && is_numeric($extra_info['user_id'])) {
[269] Fix | Delete
[270] Fix | Delete
$user_id = $extra_info['user_id'];
[271] Fix | Delete
[272] Fix | Delete
if (false == ($login_key = $this->_get_autologin_key($user_id))) return $this->_generic_error_response('user_key_failure');
[273] Fix | Delete
[274] Fix | Delete
// Default value
[275] Fix | Delete
$redirect_url = network_admin_url();
[276] Fix | Delete
if (is_array($redirect_to) && !empty($redirect_to['module'])) {
[277] Fix | Delete
switch ($redirect_to['module']) {
[278] Fix | Delete
case 'updraftplus':
[279] Fix | Delete
if ('initiate_restore' == $redirect_to['action'] && class_exists('UpdraftPlus_Options')) {
[280] Fix | Delete
$redirect_url = UpdraftPlus_Options::admin_page_url().'?page=updraftplus&udaction=initiate_restore&entities='.urlencode($redirect_to['data']['entities']).'&showdata='.urlencode($redirect_to['data']['showdata']).'&backup_timestamp='.(int) $redirect_to['data']['backup_timestamp'];
[281] Fix | Delete
[282] Fix | Delete
} elseif ('download_file' == $redirect_to['action']) {
[283] Fix | Delete
$findex = empty($redirect_to['data']['findex']) ? 0 : (int) $redirect_to['data']['findex'];
[284] Fix | Delete
// e.g. ?udcentral_action=dl&action=updraftplus_spool_file&backup_timestamp=1455101696&findex=0&what=plugins
[285] Fix | Delete
$redirect_url = site_url().'?udcentral_action=spool_file&action=updraftplus_spool_file&findex='.$findex.'&what='.urlencode($redirect_to['data']['what']).'&backup_timestamp='.(int) $redirect_to['data']['backup_timestamp'];
[286] Fix | Delete
}
[287] Fix | Delete
break;
[288] Fix | Delete
case 'direct_url':
[289] Fix | Delete
$redirect_url = $redirect_to['url'];
[290] Fix | Delete
break;
[291] Fix | Delete
}
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
$login_key = apply_filters('updraftplus_remotecontrol_login_key', array(
[295] Fix | Delete
'key' => $login_key,
[296] Fix | Delete
'created' => time(),
[297] Fix | Delete
'redirect_url' => $redirect_url
[298] Fix | Delete
), $redirect_to, $extra_info);
[299] Fix | Delete
[300] Fix | Delete
// Over-write any previous value - only one can be valid at a time)
[301] Fix | Delete
update_user_meta($user_id, 'updraftcentral_login_key', $login_key);
[302] Fix | Delete
[303] Fix | Delete
return $this->_response(array(
[304] Fix | Delete
'login_url' => network_site_url('?udcentral_action=login&login_id='.$user_id.'&login_key='.$login_key['key'])
[305] Fix | Delete
));
[306] Fix | Delete
[307] Fix | Delete
} else {
[308] Fix | Delete
return $this->_generic_error_response('user_unknown');
[309] Fix | Delete
}
[310] Fix | Delete
}
[311] Fix | Delete
[312] Fix | Delete
/**
[313] Fix | Delete
* Get information derived from phpinfo()
[314] Fix | Delete
*
[315] Fix | Delete
* @return Array
[316] Fix | Delete
*/
[317] Fix | Delete
public function phpinfo() {
[318] Fix | Delete
$phpinfo = $this->_get_phpinfo_array();
[319] Fix | Delete
[320] Fix | Delete
if (!empty($phpinfo)) {
[321] Fix | Delete
return $this->_response($phpinfo);
[322] Fix | Delete
}
[323] Fix | Delete
[324] Fix | Delete
return $this->_generic_error_response('phpinfo_fail');
[325] Fix | Delete
}
[326] Fix | Delete
[327] Fix | Delete
/**
[328] Fix | Delete
* The key obtained is only intended to be short-lived. Hence, there's no intention other than that it is random and only used once - only the most recent one is valid.
[329] Fix | Delete
*
[330] Fix | Delete
* @param Integer $user_id Specific user ID to get the autologin key
[331] Fix | Delete
* @return Array
[332] Fix | Delete
*/
[333] Fix | Delete
public function _get_autologin_key($user_id) {
[334] Fix | Delete
$secure_auth_key = defined('SECURE_AUTH_KEY') ? SECURE_AUTH_KEY : hash('sha256', DB_PASSWORD).'_'.rand(0, 999999999);
[335] Fix | Delete
if (!defined('SECURE_AUTH_KEY')) return false;
[336] Fix | Delete
$hash_it = $user_id.'_'.microtime(true).'_'.rand(0, 999999999).'_'.$secure_auth_key;
[337] Fix | Delete
$hash = hash('sha256', $hash_it);
[338] Fix | Delete
return $hash;
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
public function site_info() {
[342] Fix | Delete
global $wpdb;
[343] Fix | Delete
[344] Fix | Delete
// THis is included so we can get $wp_version
[345] Fix | Delete
@include(ABSPATH.WPINC.'/version.php');// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
[346] Fix | Delete
[347] Fix | Delete
$ud_version = is_a($this->ud, 'UpdraftPlus') ? $this->ud->version : 'none';
[348] Fix | Delete
[349] Fix | Delete
return $this->_response(array(
[350] Fix | Delete
'versions' => array(
[351] Fix | Delete
'ud' => $ud_version,
[352] Fix | Delete
'php' => PHP_VERSION,
[353] Fix | Delete
'wp' => $wp_version,// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
[354] Fix | Delete
'mysql' => $wpdb->db_version(),
[355] Fix | Delete
'udrpc_php' => $this->rc->udrpc_version,
[356] Fix | Delete
),
[357] Fix | Delete
'bloginfo' => array(
[358] Fix | Delete
'url' => network_site_url(),
[359] Fix | Delete
'name' => get_bloginfo('name'),
[360] Fix | Delete
)
[361] Fix | Delete
));
[362] Fix | Delete
}
[363] Fix | Delete
[364] Fix | Delete
/**
[365] Fix | Delete
* This calls the WP_Action within WP
[366] Fix | Delete
*
[367] Fix | Delete
* @param array $data Array of Data to be used within call_wp_action
[368] Fix | Delete
* @return array
[369] Fix | Delete
*/
[370] Fix | Delete
public function call_wordpress_action($data) {
[371] Fix | Delete
if (false === ($updraftplus_admin = $this->_load_ud_admin())) return $this->_generic_error_response('no_updraftplus');
[372] Fix | Delete
$response = $updraftplus_admin->call_wp_action($data);
[373] Fix | Delete
[374] Fix | Delete
if (empty($data["wpaction"])) {
[375] Fix | Delete
return $this->_generic_error_response("error", "no command sent");
[376] Fix | Delete
}
[377] Fix | Delete
[378] Fix | Delete
return $this->_response(array(
[379] Fix | Delete
"response" => $response['response'],
[380] Fix | Delete
"status" => $response['status'],
[381] Fix | Delete
"log" => $response['log']
[382] Fix | Delete
));
[383] Fix | Delete
}
[384] Fix | Delete
[385] Fix | Delete
/**
[386] Fix | Delete
* Get disk space used
[387] Fix | Delete
*
[388] Fix | Delete
* @uses UpdraftPlus_Filesystem_Functions::get_disk_space_used()
[389] Fix | Delete
*
[390] Fix | Delete
* @param String $entity - the entity to count (e.g. 'plugins', 'themes')
[391] Fix | Delete
*
[392] Fix | Delete
* @return Array - response
[393] Fix | Delete
*/
[394] Fix | Delete
public function count($entity) {
[395] Fix | Delete
if (!class_exists('UpdraftPlus_Filesystem_Functions')) return $this->_generic_error_response('no_updraftplus');
[396] Fix | Delete
$response = UpdraftPlus_Filesystem_Functions::get_disk_space_used($entity);
[397] Fix | Delete
[398] Fix | Delete
return $this->_response($response);
[399] Fix | Delete
}
[400] Fix | Delete
[401] Fix | Delete
/**
[402] Fix | Delete
* https://secure.php.net/phpinfo
[403] Fix | Delete
*
[404] Fix | Delete
* @return null|array
[405] Fix | Delete
*/
[406] Fix | Delete
private function _get_phpinfo_array() {
[407] Fix | Delete
if (!function_exists('phpinfo')) return null;
[408] Fix | Delete
ob_start();
[409] Fix | Delete
phpinfo(INFO_GENERAL|INFO_CREDITS|INFO_MODULES);
[410] Fix | Delete
$phpinfo = array('phpinfo' => array());
[411] Fix | Delete
[412] Fix | Delete
if (preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER)) {
[413] Fix | Delete
foreach ($matches as $match) {
[414] Fix | Delete
if (strlen($match[1])) {
[415] Fix | Delete
$phpinfo[$match[1]] = array();
[416] Fix | Delete
} elseif (isset($match[3])) {
[417] Fix | Delete
$keys1 = array_keys($phpinfo);
[418] Fix | Delete
$phpinfo[end($keys1)][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
[419] Fix | Delete
} else {
[420] Fix | Delete
$keys1 = array_keys($phpinfo);
[421] Fix | Delete
$phpinfo[end($keys1)][] = $match[2];
[422] Fix | Delete
[423] Fix | Delete
}
[424] Fix | Delete
[425] Fix | Delete
}
[426] Fix | Delete
return $phpinfo;
[427] Fix | Delete
}
[428] Fix | Delete
return false;
[429] Fix | Delete
}
[430] Fix | Delete
[431] Fix | Delete
/**
[432] Fix | Delete
* Return an UpdraftPlus_Admin object
[433] Fix | Delete
*
[434] Fix | Delete
* @return UpdraftPlus_Admin|Boolean - false in case of failure
[435] Fix | Delete
*/
[436] Fix | Delete
private function _load_ud_admin() {
[437] Fix | Delete
if (!defined('UPDRAFTPLUS_DIR') || !is_file(UPDRAFTPLUS_DIR.'/admin.php')) return false;
[438] Fix | Delete
include_once(UPDRAFTPLUS_DIR.'/admin.php');
[439] Fix | Delete
global $updraftplus_admin;
[440] Fix | Delete
return $updraftplus_admin;
[441] Fix | Delete
}
[442] Fix | Delete
}
[443] Fix | Delete
[444] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function