| @@ -8,9 +8,9 @@ | ||
| 8 | 8 | |
| 9 | 9 | public function __construct() { |
| 10 | 10 | |
| 11 | 11 | if ( ! Hostinger_Settings::get_setting( 'first_login_at' ) ) { |
| 12 | - Hostinger_Settings::update_setting( 'first_login_at', date( 'Y-m-d H:i:s' ) ); | |
| 12 | + Hostinger_Settings::update_setting( 'first_login_at', gmdate( 'Y-m-d H:i:s' ) ); | |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | if ( ! isset( $_GET['platform'] ) ) { |
| 16 | 16 | return; |
| @@ -15,19 +15,22 @@ | ||
| 15 | 15 | if ( ! isset( $_GET['platform'] ) ) { |
| 16 | 16 | return; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - $this->platform = $_GET['platform']; | |
| 20 | - $this->loginRedirect(); | |
| 19 | + $this->platform = sanitize_text_field( $_GET['platform'] ); | |
| 20 | + $this->login_redirect(); | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - private function loginRedirect(): void { | |
| 23 | + private function login_redirect(): void { | |
| 24 | 24 | if ( $this->platform === self::PLATFORM_HPANEL ) { |
| 25 | - add_action( 'init', static function () { | |
| 26 | - $redirect_url = admin_url( 'admin.php?page=hostinger' ); | |
| 27 | - wp_redirect( $redirect_url ); | |
| 28 | - exit; | |
| 29 | - } ); | |
| 25 | + add_action( | |
| 26 | + 'init', | |
| 27 | + static function () { | |
| 28 | + $redirect_url = admin_url( 'admin.php?page=hostinger' ); | |
| 29 | + wp_safe_redirect( $redirect_url ); | |
| 30 | + exit; | |
| 31 | + } | |
| 32 | + ); | |
| 30 | 33 | } |
| 31 | 34 | } |
| 32 | 35 | } |
| 33 | 36 | |