Changeset 3728354 for retainful/trunk/App/Controllers/Webhook.php
- Timestamp:
- 10/05/2026 08:05:53 AM (13 days ago)
- File:
-
- 1 edited
-
retainful/trunk/App/Controllers/Webhook.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
retainful/trunk/App/Controllers/Webhook.php
r3705113 r3728354 15 15 use RTFL\App\Helpers\Platform; 16 16 use RTFL\App\Helpers\Product; 17 use RTFL\App\Helpers\RateLimiter; 17 18 use RTFL\App\Helpers\Settings; 18 19 use RTFL\App\Helpers\Util; … … 516 517 } 517 518 518 // 2. Input validation 519 if ( RateLimiter::isEnabled() && ! RateLimiter::checkLimit( 'trackProductViewed' )['allowed'] ) { 520 wp_send_json_error( [ 'message' => __( 'Rate limit exceeded', 'retainful' ) ], 429 ); 521 } 522 523 // 2. Input validation. The email comes from the server-side identity (logged-in user / session), 524 // never from the request, so a visitor cannot trigger product-view events for someone else's email. 519 525 $product_id = absint( Input::get( 'product_id', 0 ) ); 520 $email = sanitize_email( Input::get( 'email', '' ));526 $email = \RTFL\App\Controllers\Store\Common::getIdentifiedCustomerEmail(); 521 527 522 528 if ( ! $product_id || ! is_email( $email ) ) { … … 838 844 ], 403 ); 839 845 } 846 if ( RateLimiter::isEnabled() && ! RateLimiter::checkLimit( 'trackUserData' )['allowed'] ) { 847 wp_send_json_error( [ 848 'message' => __( 'Rate limit exceeded', 'retainful' ) 849 ], 429 ); 850 } 840 851 } 841 852 if ( ! function_exists( 'wc_get_webhook' ) || ! function_exists( 'as_next_scheduled_action' ) || ! function_exists( 'as_schedule_single_action' ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)