Commit a982699
committed
fix: prevent wp_sanitize_redirect from stripping domain in payment URLs
- Remove wp_sanitize_redirect() from callback/complete/fail URLs
- Use esc_url_raw() for URL sanitization (sufficient for API payloads)
- Update token generation to use wc_get_account_endpoint_url() for absolute URLs
wp_sanitize_redirect() strips domains not in WordPress allowed hosts list,
causing completeUrl to become relative instead of absolute. MONEI API
requires absolute URLs for callbacks. Since these URLs are internally
generated (not user input) and already sanitized with esc_url_raw(),
removing wp_sanitize_redirect() is safe and fixes payment failures.
Affected files:
- WCMoneiPaymentGatewayHosted.php
- WCMoneiPaymentGatewayComponent.php
- WCGatewayMoneiCC.php
Fixes issue where completeUrl was sent as /order-received/123/ instead
of https://example.com/order-received/123/1 parent 62c8df2 commit a982699
File tree
3 files changed
+14
-16
lines changed- src/Gateways
- Abstracts
- PaymentMethods
3 files changed
+14
-16
lines changedLines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
217 | 215 | | |
218 | 216 | | |
219 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
0 commit comments