403Webshell
Server IP : 167.179.152.94  /  Your IP : 216.73.216.169
Web Server : Apache/2.4.66 (Debian)
System : Linux 6d8cbb3dc321 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64
User :  ( 1000)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/visual-portfolio/gutenberg/utils/control-get-value/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/visual-portfolio/gutenberg/utils/control-get-value/index.php
<?php
/**
 * Control condition check.
 *
 * @package visual-portfolio
 */

/**
 * Visual_Portfolio_Control_Get_Value
 */
class Visual_Portfolio_Control_Get_Value {
	/**
	 * Get control value.
	 * Supported array names like `images[3].format`
	 *
	 * @param string $name - control name.
	 * @param array  $attributes - block attributes.
	 *
	 * @return mixed value.
	 */
	public static function get( $name, $attributes ) {
		$val = isset( $attributes[ $name ] ) ? $attributes[ $name ] : null;

		// Parse arrays and objects.
		// Example `images[3].format`.
		if ( null !== $val && preg_match( '/[\[\.]/', $name ) ) {
			// Find parts, used for objects.
			// Example `images.format`.
			$val_object_parts = explode( '.', $name );
			$val_parts        = array();

			if ( $val_object_parts && ! empty( $val_object_parts ) ) {
				// Find parts, used for arrays.
				// Example `images[3]`.
				foreach ( $val_object_parts as $obj_part ) {
					if ( preg_match( '/[\[]/', $obj_part ) ) {
						$val_array_parts = preg_split( '/[\[\]]/', $obj_part );

						if ( $val_array_parts && ! empty( $val_array_parts ) ) {
							foreach ( $val_array_parts as $arr_part ) {
								if ( '' !== $arr_part ) {
									$arr_part_int = (int) $arr_part;
									if ( "$arr_part_int" === $arr_part ) {
										$val_parts[] = $arr_part_int;
									} else {
										$val_parts[] = $arr_part;
									}
								}
							}
						}
					} else {
						$val_parts[] = $obj_part;
					}
				}

				// Try to find value in attributes.
				if ( ! empty( $val_parts ) ) {
					$current_val = $attributes;

					foreach ( $val_parts as $part_name ) {
						if ( $current_val && isset( $current_val[ $part_name ] ) ) {
							$current_val = $current_val[ $part_name ];
						} else {
							$current_val = null;
						}
					}

					$val = $current_val;
				}
			}
		}

		return $val;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit