mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Restrict the BN code to return only the white listed values
This commit is contained in:
parent
95af76b8fb
commit
2616974c12
1 changed files with 7 additions and 1 deletions
|
@ -80,6 +80,12 @@ class PartnerAttribution {
|
|||
* @return string The stored BN Code, or the default value if no path is detected.
|
||||
*/
|
||||
public function get_bn_code(): string {
|
||||
return get_option( $this->bn_code_option_name, $this->default_bn_code ) ?? $this->default_bn_code;
|
||||
$bn_code = get_option( $this->bn_code_option_name, $this->default_bn_code ) ?? $this->default_bn_code;
|
||||
|
||||
if ( ! in_array( $bn_code, $this->bn_codes, true ) && $bn_code !== $this->default_bn_code ) {
|
||||
return $this->default_bn_code;
|
||||
}
|
||||
|
||||
return $bn_code;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue