X7ROOT File Manager
Current Path:
/home/gfecatvj/4abetter.us/wp-content/plugins/woocommerce/src/Utilities
home
/
gfecatvj
/
4abetter.us
/
wp-content
/
plugins
/
woocommerce
/
src
/
Utilities
/
📁
..
📄
ArrayUtil.php
(12.99 KB)
📄
DiscountsUtil.php
(1.1 KB)
📄
FeaturesUtil.php
(4.23 KB)
📄
I18nUtil.php
(1.69 KB)
📄
LoggingUtil.php
(3.18 KB)
📄
NumberUtil.php
(7.11 KB)
📄
OrderUtil.php
(8.71 KB)
📄
PluginUtil.php
(12.89 KB)
📄
RestApiUtil.php
(781 B)
📄
ShippingUtil.php
(1020 B)
📄
StringUtil.php
(5.09 KB)
📄
TimeUtil.php
(1.16 KB)
Editing: 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; } }
Upload File
Create Folder