PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.64
Timetics – Appointment Booking Calendar & Scheduling v1.0.64
1.0.64 1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 All 65 releases
← All changes | core/integrations/google/client.php +4 -2 1.0.61 → 1.0.64 View file →
@@ -5,8 +5,10 @@
5 5 * @package Timetics
6 6 */
7 7 namespace Timetics\Core\Integrations\Google;
8 8
9 +defined( 'ABSPATH' ) || exit;
10 +
9 11 use Exception;
10 12 use InvalidArgumentException;
11 13
12 14 /**
@@ -165,9 +167,9 @@
165 167
166 168 $response = wp_remote_post( self::TIMETICS_TOKEN_URI, array( 'body' => $args ) );
167 169
168 170 if ( is_wp_error( $response ) ) {
169 - throw new Exception( $response->get_error_message() );
171 + throw new Exception( esc_html( $response->get_error_message() ) );
170 172 }
171 173
172 174 $status_code = (int) wp_remote_retrieve_response_code( $response );
173 175 $body = wp_remote_retrieve_body( $response );
@@ -174,9 +176,9 @@
174 176 $data = json_decode( $body, true );
175 177
176 178 if ( 200 !== $status_code || empty( $data['access_token'] ) ) {
177 179 $message = ! empty( $data['error_description'] ) ? $data['error_description'] : __( 'Failed to obtain Google access token.', 'timetics' );
178 - throw new Exception( $message );
180 + throw new Exception( esc_html( $message ) );
179 181 }
180 182
181 183 return $data;
182 184 }