403Webshell
Server IP : 198.54.115.198  /  Your IP : 216.73.216.142
Web Server : LiteSpeed
System : Linux server192.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User : seatpheu ( 1569)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/cwd/wp-content/plugins/advanced-custom-fields/includes/ajax/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/cwd/wp-content/plugins/advanced-custom-fields/includes/ajax/class-acf-ajax-upgrade.php
<?php
/**
 * @package ACF
 * @author  WP Engine
 *
 * © 2026 Advanced Custom Fields (ACF®). All rights reserved.
 * "ACF" is a trademark of WP Engine.
 * Licensed under the GNU General Public License v2 or later.
 * https://www.gnu.org/licenses/gpl-2.0.html
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

if ( ! class_exists( 'ACF_Ajax_Upgrade' ) ) :

	class ACF_Ajax_Upgrade extends ACF_Ajax {

		/** @var string The AJAX action name */
		var $action = 'acf/ajax/upgrade';

		/**
		 * Returns the response data to sent back.
		 *
		 * @since 5.7.2
		 *
		 * @param array $request The request args.
		 * @return boolean|WP_Error True if successful, or WP_Error on failure.
		 */
		public function get_response( $request ) {
			if ( ! current_user_can( acf_get_setting( 'capability' ) ) ) {
				return new WP_Error( 'upgrade_error', __( 'Sorry, you do not have permission to do that.', 'acf' ) );
			}

			// Switch blog.
			$switched = false;
			if ( isset( $request['blog_id'] ) ) {
				if ( ! is_super_admin() ) {
					return new WP_Error( 'upgrade_error', __( 'Sorry, you do not have permission to do that.', 'acf' ) );
				}

				$blog_id = absint( $request['blog_id'] );
				if ( ! $blog_id || ! get_site( $blog_id ) ) {
					return new WP_Error( 'upgrade_error', __( 'Invalid site ID.', 'acf' ) );
				}

				switch_to_blog( $blog_id );
				$switched = true;
			}

			// Bail early if no upgrade available.
			if ( ! acf_has_upgrade() ) {
				if ( $switched ) {
					restore_current_blog();
				}
				return new WP_Error( 'upgrade_error', __( 'No updates available.', 'acf' ) );
			}

			// Listen for output.
			ob_start();

			// Run upgrades.
			acf_upgrade_all();

			// Store output.
			$error = ob_get_clean();

			if ( $switched ) {
				restore_current_blog();
			}

			// Return error or success.
			if ( $error ) {
				return new WP_Error( 'upgrade_error', $error );
			}

			return true;
		}
	}

	acf_new_instance( 'ACF_Ajax_Upgrade' );
endif; // class_exists check

Youez - 2016 - github.com/yon3zu
LinuXploit