403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.147.126.33
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/home/giankuin/dietcontrungnhanh.com/wp-content/plugins/woocommerce/src/Admin/RemoteSpecs/RuleProcessors/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/giankuin/dietcontrungnhanh.com/wp-content/plugins/woocommerce/src/Admin/RemoteSpecs/RuleProcessors/ComparisonOperation.php
<?php
/**
 * Compare two operands using the specified operation.
 */

namespace Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors;

defined( 'ABSPATH' ) || exit;

/**
 * Compare two operands using the specified operation.
 */
class ComparisonOperation {
	/**
	 * Compare two operands using the specified operation.
	 *
	 * @param object $left_operand  The left hand operand.
	 * @param object $right_operand The right hand operand -- 'value' from the rule definition.
	 * @param string $operation     The operation used to compare the operands.
	 */
	public static function compare( $left_operand, $right_operand, $operation ) {
		switch ( $operation ) {
			case '=':
				return $left_operand === $right_operand;
			case '<':
				return $left_operand < $right_operand;
			case '<=':
				return $left_operand <= $right_operand;
			case '>':
				return $left_operand > $right_operand;
			case '>=':
				return $left_operand >= $right_operand;
			case '!=':
				return $left_operand !== $right_operand;
			case 'contains':
				if ( is_array( $left_operand ) && is_string( $right_operand ) ) {
					return in_array( $right_operand, $left_operand, true );
				}
				if ( is_string( $right_operand ) && is_string( $left_operand ) ) {
					return strpos( $right_operand, $left_operand ) !== false;
				}
				break;
			case '!contains':
				if ( is_array( $left_operand ) && is_string( $right_operand ) ) {
					return ! in_array( $right_operand, $left_operand, true );
				}
				if ( is_string( $right_operand ) && is_string( $left_operand ) ) {
					return strpos( $right_operand, $left_operand ) === false;
				}
				break;
			case 'in':
				if ( is_array( $right_operand ) && is_string( $left_operand ) ) {
					return in_array( $left_operand, $right_operand, true );
				}
				if ( is_string( $left_operand ) && is_string( $right_operand ) ) {
					return strpos( $left_operand, $right_operand ) !== false;
				}
				break;
			case '!in':
				if ( is_array( $right_operand ) && is_string( $left_operand ) ) {
					return ! in_array( $left_operand, $right_operand, true );
				}
				if ( is_string( $left_operand ) && is_string( $right_operand ) ) {
					return strpos( $left_operand, $right_operand ) === false;
				}
				break;
			case 'range':
				if ( ! is_array( $right_operand ) || count( $right_operand ) !== 2 ) {
					return false;
				}
				return $left_operand >= $right_operand[0] && $left_operand <= $right_operand[1];
		}

		return false;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit