← All changes
|
modules/subscriptions/jetpack-user-content-link-redirection.php
+5
-7
13.7.2
→
16.3-a.1
View file →
| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | function jetpack_user_content_link_redirection() { |
| 26 | 26 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 27 | 27 | if ( empty( $_SERVER['QUERY_STRING'] ) || empty( $_SERVER['HTTP_HOST'] ) || empty( $_GET['blog_id'] ) ) { |
| 28 | 28 | wp_safe_redirect( get_home_url() ); |
| 29 | - exit(); | |
| 29 | + exit( 0 ); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 33 | 33 | $request_blog_id = intval( sanitize_text_field( wp_unslash( $_GET['blog_id'] ) ) ); |
| @@ -34,16 +34,15 @@ | ||
| 34 | 34 | $actual_blog_id = Connection_Manager::get_site_id( true ); |
| 35 | 35 | |
| 36 | 36 | if ( $actual_blog_id !== $request_blog_id ) { |
| 37 | 37 | wp_die( esc_html__( 'Invalid link.', 'jetpack' ), 400 ); |
| 38 | - exit(); | |
| 38 | + exit( 0 ); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $query_params = sanitize_text_field( wp_unslash( $_SERVER['QUERY_STRING'] ) ); |
| 42 | 42 | $iframe_url = "https://subscribe.wordpress.com/?$query_params"; |
| 43 | 43 | |
| 44 | - // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 45 | - echo <<<EOF | |
| 44 | + echo <<<'EOF' | |
| 46 | 45 | <!DOCTYPE html> |
| 47 | 46 | <html> |
| 48 | 47 | <head> |
| 49 | 48 | <script> |
| @@ -61,14 +60,13 @@ | ||
| 61 | 60 | </head> |
| 62 | 61 | <body> |
| 63 | 62 | EOF; |
| 64 | 63 | echo '<iframe id="user-content-link-redirection" hidden aria-hidden="true" tabindex="-1" width="0" height="0" style="display: none" src="' . esc_url( $iframe_url ) . '"></iframe>'; |
| 65 | - echo <<<EOF | |
| 64 | + echo <<<'EOF' | |
| 66 | 65 | </body> |
| 67 | 66 | </html> |
| 68 | 67 | EOF; |
| 69 | - // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 70 | - exit; | |
| 68 | + exit( 0 ); | |
| 71 | 69 | } |
| 72 | 70 | |
| 73 | 71 | // The WPCOM_USER_CONTENT_LINK_REDIRECTION flag prevents this redirection logic from running |
| 74 | 72 | // on Atomic in case we'd like to override the redirection logic on the Atomic end. |