← All changes
|
app/Core/Handlers/EmailVerificationPageHandler.php
+13
-9
3.0.3
→
3.0.16
View file →
| @@ -18,19 +18,23 @@ | ||
| 18 | 18 | { |
| 19 | 19 | $token = isset($route_data['token']) ? (string) $route_data['token'] : ''; |
| 20 | 20 | $token = preg_replace('/[^a-zA-Z0-9_-]/', '', $token) ?? ''; |
| 21 | 21 | |
| 22 | - if ($token === '') { | |
| 23 | - $this->prevent404(); | |
| 24 | - AuthController::handleEmailVerification(); | |
| 22 | + // AuthController::handleEmailVerification() performs wp_redirect/wp_die internally | |
| 23 | + // and never returns to the template flow — so we don't queue a template via | |
| 24 | + // PageContext. We still configure the page environment so any partial-failure | |
| 25 | + // path that DOES return doesn't render the theme's 404. | |
| 26 | + $this->setupPageEnvironment('singular', [ | |
| 27 | + 'title' => __('Email Verification', 'yatra'), | |
| 28 | + 'post_type' => 'page', | |
| 29 | + 'post_name' => $token !== '' ? 'verify-email/' . $token : 'verify-email', | |
| 30 | + ]); | |
| 25 | 31 | |
| 26 | - return true; | |
| 32 | + if ($token !== '') { | |
| 33 | + $this->setQueryVars([ | |
| 34 | + 'yatra_verify_email' => $token, | |
| 35 | + ]); | |
| 27 | 36 | } |
| 28 | - | |
| 29 | - $this->prevent404(); | |
| 30 | - $this->setQueryVars([ | |
| 31 | - 'yatra_verify_email' => $token, | |
| 32 | - ]); | |
| 33 | 37 | |
| 34 | 38 | AuthController::handleEmailVerification(); |
| 35 | 39 | |
| 36 | 40 | return true; |