Skip to content

Commit 9138b24

Browse files
author
Woo
committed
Updates to 1.8.9
1 parent 185ba4e commit 9138b24

File tree

685 files changed

+762
-748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

685 files changed

+762
-748
lines changed

changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
*** Xero Integration ***
22

3+
2024-08-19 - version 1.8.9
4+
* Fix - PHPCompatibility errors reported by the QIT test.
5+
* Dev - Bump WooCommerce "tested up to" version 9.2.
6+
* Dev - Bump WooCommerce minimum supported version to 9.0.
7+
* Dev - Fix QIT E2E tests and add support for a few new test types.
8+
39
2024-07-22 - version 1.8.8
410
* Dev - Bump WooCommerce "tested up to" version 9.1.
511
* Dev - Bump WooCommerce minimum supported version to 8.9.

includes/class-wc-xr-address.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function get_type() {
2525
* @param string $type
2626
*/
2727
public function set_type( $type ) {
28-
$this->type = htmlspecialchars( $type );
28+
$this->type = htmlspecialchars( $type, ENT_COMPAT );
2929
}
3030

3131
/**
@@ -39,7 +39,7 @@ public function get_line_1() {
3939
* @param string $line_1
4040
*/
4141
public function set_line_1( $line_1 ) {
42-
$this->line_1 = htmlspecialchars( $line_1 );
42+
$this->line_1 = htmlspecialchars( $line_1, ENT_COMPAT );
4343
}
4444

4545
/**
@@ -53,7 +53,7 @@ public function get_line_2() {
5353
* @param string $line_2
5454
*/
5555
public function set_line_2( $line_2 ) {
56-
$this->line_2 = htmlspecialchars( $line_2 );
56+
$this->line_2 = htmlspecialchars( $line_2, ENT_COMPAT );
5757
}
5858

5959
/**
@@ -67,7 +67,7 @@ public function get_city() {
6767
* @param string $city
6868
*/
6969
public function set_city( $city ) {
70-
$this->city = htmlspecialchars( $city );
70+
$this->city = htmlspecialchars( $city, ENT_COMPAT );
7171
}
7272

7373
/**
@@ -81,7 +81,7 @@ public function get_region() {
8181
* @param string $region
8282
*/
8383
public function set_region( $region ) {
84-
$this->region = htmlspecialchars( $region );
84+
$this->region = htmlspecialchars( $region, ENT_COMPAT );
8585
}
8686

8787
/**
@@ -95,7 +95,7 @@ public function get_postal_code() {
9595
* @param string $postal_code
9696
*/
9797
public function set_postal_code( $postal_code ) {
98-
$this->postal_code = htmlspecialchars( $postal_code );
98+
$this->postal_code = htmlspecialchars( $postal_code, ENT_COMPAT );
9999
}
100100

101101
/**
@@ -109,7 +109,7 @@ public function get_country() {
109109
* @param string $country
110110
*/
111111
public function set_country( $country ) {
112-
$this->country = htmlspecialchars( $country );
112+
$this->country = htmlspecialchars( $country, ENT_COMPAT );
113113
}
114114

115115
/**

includes/class-wc-xr-contact.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function get_name() {
4040
* @param string $name
4141
*/
4242
public function set_name( $name ) {
43-
$this->name = htmlspecialchars( $name );
43+
$this->name = htmlspecialchars( $name, ENT_COMPAT );
4444
}
4545

4646
/**
@@ -54,7 +54,7 @@ public function get_first_name() {
5454
* @param string $first_name
5555
*/
5656
public function set_first_name( $first_name ) {
57-
$this->first_name = htmlspecialchars( $first_name );
57+
$this->first_name = htmlspecialchars( $first_name, ENT_COMPAT );
5858
}
5959

6060
/**
@@ -68,7 +68,7 @@ public function get_last_name() {
6868
* @param string $last_name
6969
*/
7070
public function set_last_name( $last_name ) {
71-
$this->last_name = htmlspecialchars( $last_name );
71+
$this->last_name = htmlspecialchars( $last_name, ENT_COMPAT );
7272
}
7373

7474
/**
@@ -82,7 +82,7 @@ public function get_email_address() {
8282
* @param string $email_address
8383
*/
8484
public function set_email_address( $email_address ) {
85-
$this->email_address = htmlspecialchars( $email_address );
85+
$this->email_address = htmlspecialchars( $email_address, ENT_COMPAT );
8686
}
8787

8888
/**

includes/class-wc-xr-line-item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function get_description() {
8686
* @param string $description
8787
*/
8888
public function set_description( $description ) {
89-
$this->description = htmlspecialchars( $description );
89+
$this->description = htmlspecialchars( $description, ENT_COMPAT );
9090
}
9191

9292
/**

includes/class-wc-xr-oauth-simple.php

Lines changed: 59 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -407,57 +407,65 @@ function _normalizedParameters($filter='false') {
407407
return join('&',$elements);
408408
}
409409

410-
function _generateSignature () {
411-
$secretKey = '';
412-
if(isset($this->_secrets['shared_secret']))
413-
$secretKey = $this->_oauthEscape($this->_secrets['shared_secret']);
414-
$secretKey .= '&';
415-
if(isset($this->_secrets['oauth_secret']))
416-
$secretKey .= $this->_oauthEscape($this->_secrets['oauth_secret']);
417-
switch($this->_parameters['oauth_signature_method'])
418-
{
419-
case 'RSA-SHA1':
420-
421-
// Fetch the public key
422-
$publickey = openssl_get_publickey($this->_secrets['public_key']);
423-
if ( $publickey == false ) {
424-
throw new WC_XR_OAuthSimpleException('Unable to retrieve public key.');
425-
return;
426-
}
427-
428-
// Fetch the private key
429-
$privatekeyid = openssl_get_privatekey($this->_secrets['private_key']);
430-
if ( $privatekeyid == false ) {
431-
throw new WC_XR_OAuthSimpleException('Unable to retrieve private key.');
432-
return;
433-
}
434-
435-
// Sign using the key
436-
437-
$this->sbs = $this->_oauthEscape($this->_action).'&'.$this->_oauthEscape($this->_path).'&'.$this->_oauthEscape($this->_normalizedParameters());
438-
439-
$ok = openssl_sign($this->sbs, $signature, $privatekeyid);
440-
if ( $ok == false ) {
441-
throw new WC_XR_OAuthSimpleException('Error generating signature.');
442-
return;
443-
}
444-
445-
// Release the key resource
446-
openssl_free_key($privatekeyid);
447-
448-
return base64_encode($signature);
449-
//return base64_encode(hash_hmac('sha1',$this->sbs,$secretKey,true));
450-
451-
case 'PLAINTEXT':
452-
return urlencode($secretKey);
410+
/**
411+
* Generate the signature.
412+
*
413+
* @throws WC_XR_OAuthSimpleException If the signature method is unknown.
414+
*
415+
* @return string The signature.
416+
*/
417+
public function generate_signature() {
418+
$secret_key = '';
453419

454-
case 'HMAC-SHA1':
455-
$this->sbs = $this->_oauthEscape($this->_action).'&'.$this->_oauthEscape($this->_path).'&'.$this->_oauthEscape($this->_normalizedParameters());
456-
//error_log('SBS: '.$sigString);
457-
return base64_encode(hash_hmac('sha1',$this->sbs,$secretKey,true));
420+
if ( isset( $this->_secrets['shared_secret'] ) ) {
421+
$secret_key .= $this->_oauth_escape( $this->_secrets['shared_secret'] );
422+
}
458423

459-
default:
460-
throw new WC_XR_OAuthSimpleException('Unknown signature method for OAuthSimple');
461-
}
462-
}
424+
$secret_key .= '&';
425+
426+
if ( isset( $this->_secrets['oauth_secret'] ) ) {
427+
$secret_key .= $this->_oauth_escape( $this->_secrets['oauth_secret'] );
428+
}
429+
430+
switch ( $this->_parameters['oauth_signature_method'] ) {
431+
case 'RSA-SHA1':
432+
// Fetch the public key.
433+
$public_key = openssl_get_publickey( $this->_secrets['public_key'] );
434+
435+
if ( false === $public_key ) {
436+
throw new WC_XR_OAuthSimpleException( 'Unable to retrieve public key.' );
437+
}
438+
439+
// Fetch the private key.
440+
$private_key_id = openssl_get_privatekey( $this->_secrets['private_key'] );
441+
442+
if ( false === $private_key_id ) {
443+
throw new WC_XR_OAuthSimpleException( 'Unable to retrieve private key.' );
444+
}
445+
446+
// Sign using the key.
447+
$this->sbs = $this->_oauth_escape( $this->_action ) . '&' . $this->_oauth_escape( $this->_path ) . '&' . $this->_oauth_escape( $this->_normalized_parameters() );
448+
449+
$ok = openssl_sign( $this->sbs, $signature, $private_key_id );
450+
451+
if ( false === $ok ) {
452+
throw new WC_XR_OAuthSimpleException( 'Error generating signature.' );
453+
}
454+
455+
// Release the key resource.
456+
unset( $private_key_id );
457+
458+
return base64_encode( $signature ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
459+
460+
case 'PLAINTEXT':
461+
return urlencode( $secret_key ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
462+
463+
case 'HMAC-SHA1':
464+
$this->sbs = $this->_oauth_escape( $this->_action ) . '&' . $this->_oauth_escape( $this->_path ) . '&' . $this->_oauth_escape( $this->_normalized_parameters() );
465+
return base64_encode( hash_hmac( 'sha1', $this->sbs, $secret_key, true ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
466+
467+
default:
468+
throw new WC_XR_OAuthSimpleException( 'Unknown signature method for OAuthSimple' );
469+
}
470+
}
463471
}

includes/class-wc-xr-phone.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function get_type() {
2929
* @param string $type
3030
*/
3131
public function set_type( $type ) {
32-
$this->type = htmlspecialchars( $type );
32+
$this->type = htmlspecialchars( $type, ENT_COMPAT );
3333
}
3434

3535
/**
@@ -43,7 +43,7 @@ public function get_number() {
4343
* @param string $number
4444
*/
4545
public function set_number( $number ) {
46-
$this->number = htmlspecialchars( $number );
46+
$this->number = htmlspecialchars( $number, ENT_COMPAT );
4747
}
4848

4949
/**

languages/woocommerce-xero.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the same license as the WooCommerce Xero Integration package.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: WooCommerce Xero Integration 1.8.8\n"
5+
"Project-Id-Version: WooCommerce Xero Integration 1.8.9\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-xero\n"
7-
"POT-Creation-Date: 2024-07-22 16:05:03+00:00\n"
7+
"POT-Creation-Date: 2024-08-19 14:03:55+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"

lib/packages/firebase/php-jwt/src/BeforeValidException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @license BSD-3-Clause
44
*
5-
* Modified by woocommerce on 22-July-2024 using Strauss.
5+
* Modified by woocommerce on 19-August-2024 using Strauss.
66
* @see https://github.com/BrianHenryIE/strauss
77
*/
88

lib/packages/firebase/php-jwt/src/CachedKeySet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @license BSD-3-Clause
44
*
5-
* Modified by woocommerce on 22-July-2024 using Strauss.
5+
* Modified by woocommerce on 19-August-2024 using Strauss.
66
* @see https://github.com/BrianHenryIE/strauss
77
*/
88

lib/packages/firebase/php-jwt/src/ExpiredException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @license BSD-3-Clause
44
*
5-
* Modified by woocommerce on 22-July-2024 using Strauss.
5+
* Modified by woocommerce on 19-August-2024 using Strauss.
66
* @see https://github.com/BrianHenryIE/strauss
77
*/
88

0 commit comments

Comments
 (0)