Changeset 14808
- Timestamp:
- 04/13/2026 03:08:50 AM (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/dotorg/slack/community-deputies-calendly-webhook.php
r12736 r14808 18 18 } 19 19 20 $req = wp_remote_get( 20 if ( 'api.calendly.com' !== parse_url( $url, PHP_URL_HOST ) ) { 21 trigger_error( 22 'Invalid URL provided to api_request, only api.calendly.com URLs are allowed.', 23 E_USER_WARNING 24 ); 25 26 return false; 27 } 28 29 $req = wp_safe_remote_get( 21 30 $url, 22 31 [ … … 41 50 42 51 // Check the request is valid. 43 if ( empty( $_GET['secret'] ) || $_GET['secret'] !== COMMUNITY_CALENDLY_SECRET ) { 44 die(); 52 if ( empty( $_GET['secret'] ) || ! hash_equals( COMMUNITY_CALENDLY_SECRET, $_GET['secret'] ) ) { 53 header( 'HTTP/1.1 403 Forbidden' ); 54 die( 'Invalid secret provided.' ); 45 55 } 46 56 … … 49 59 $event = $request_body_parsed->event ?? ''; 50 60 if ( ! $event ) { 51 die(); 61 header( 'HTTP/1.1 400 Bad Request' ); 62 die( 'Invalid event provided.' ); 52 63 } 53 64
Note: See TracChangeset
for help on using the changeset viewer.