SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > woocommerce > > src > > Utilities


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/woocommerce//src//Utilities

NameTypeSizeLast ModifiedActions
ArrayUtil.php File 13299 bytes May 12 2025 21:07:28.
DiscountsUtil.php File 1130 bytes May 30 2024 18:23:46.
FeaturesUtil.php File 4598 bytes January 25 2023 03:19:12.
I18nUtil.php File 1727 bytes February 22 2023 07:17:34.
LoggingUtil.php File 3259 bytes August 27 2024 23:04:44.
NumberUtil.php File 6029 bytes March 03 2025 22:28:12.
OrderUtil.php File 8370 bytes May 12 2025 21:07:28.
PluginUtil.php File 13199 bytes March 03 2025 22:28:12.
RestApiUtil.php File 781 bytes May 28 2024 14:28:20.
ShippingUtil.php File 1020 bytes May 12 2025 21:07:28.
StringUtil.php File 5212 bytes June 04 2024 15:20:30.
TimeUtil.php File 1186 bytes January 30 2024 23:24:56.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/woocommerce//src//Utilities/DiscountsUtil.php

<?php
/**
 * DiscountsUtil class file.
 */

namespace Automattic\WooCommerce\Utilities;

/**
 * The DiscountsUtil class provides utilities to assist discounts calculation and validation.
 */
class DiscountsUtil {

	/**
	 * Checks if the given email address(es) matches the ones specified on the coupon.
	 *
	 * @param array $check_emails Array of customer email addresses.
	 * @param array $restrictions Array of allowed email addresses.
	 *
	 * @return bool
	 */
	public static function is_coupon_emails_allowed( $check_emails, $restrictions ) {

		foreach ( $check_emails as $check_email ) {
			// With a direct match we return true.
			if ( in_array( $check_email, $restrictions, true ) ) {
				return true;
			}

			// Go through the allowed emails and return true if the email matches a wildcard.
			foreach ( $restrictions as $restriction ) {
				// Convert to PHP-regex syntax.
				$regex = '/^' . str_replace( '*', '(.+)?', $restriction ) . '$/';
				preg_match( $regex, $check_email, $match );
				if ( ! empty( $match ) ) {
					return true;
				}
			}
		}

		// No matches, this one isn't allowed.
		return false;
	}
}

SILENT KILLER Tool