Merge pull request #25466 from woocommerce/update/25464

Trim whitespaces and strip slashes from MaxMind License Key
This commit is contained in:
Rodrigo Primo 2020-01-22 15:45:06 -03:00 committed by GitHub
commit b948545283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -132,7 +132,10 @@ class WC_Integration_MaxMind_Geolocation extends WC_Integration {
* @throws Exception When the license key is invalid.
*/
public function validate_license_key_field( $key, $value ) {
// Empty license keys have no need to validate the data.
// Trim whitespaces and strip slashes.
$value = $this->validate_password_field( $key, $value );
// Empty license keys have no need test downloading a database.
if ( empty( $value ) ) {
return $value;
}