Analytics.php
1 month ago
AutomatedLatestContent.php
3 months ago
AutomaticEmails.php
3 years ago
Captcha.php
9 hours ago
Coupons.php
2 years ago
CustomFields.php
3 months ago
DynamicProducts.php
1 year ago
DynamicSegments.php
3 months ago
FeatureFlags.php
3 years ago
Forms.php
3 months ago
Help.php
1 year ago
ImportExport.php
3 months ago
Mailer.php
2 weeks ago
NewsletterLinks.php
9 hours ago
NewsletterTemplates.php
3 months ago
Newsletters.php
3 months ago
Premium.php
11 months ago
RedirectResponse.php
9 hours ago
Segments.php
1 month ago
SendingQueue.php
3 months ago
Services.php
7 months ago
Settings.php
3 months ago
Setup.php
1 year ago
StatisticsExport.php
4 months ago
SubscriberStats.php
2 months ago
Subscribers.php
3 months ago
Tags.php
3 years ago
UserFlags.php
2 years ago
WoocommerceProductVariations.php
3 months ago
WoocommerceSettings.php
3 years ago
index.php
3 years ago
RedirectResponse.php
25 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\API\JSON\v1; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\API\JSON\Response; |
| 9 | use MailPoet\WP\Functions as WPFunctions; |
| 10 | |
| 11 | class RedirectResponse extends Response { |
| 12 | |
| 13 | public function __construct($location) { // phpcs:ignore |
| 14 | $wp = WPFunctions::get(); |
| 15 | // Keep redirects on-site unless a host is explicitly allowed via WordPress' |
| 16 | // allowed_redirect_hosts filter, mirroring wp_safe_redirect() handling. |
| 17 | $location = $wp->wpValidateRedirect($location, $wp->homeUrl()); |
| 18 | parent::__construct(self::REDIRECT, [], $location); |
| 19 | } |
| 20 | |
| 21 | public function getData() { |
| 22 | return []; |
| 23 | } |
| 24 | } |
| 25 |