Last active
May 12, 2020 12:30
-
-
Save woutersf/57a3436642276b247ec9c3b675d89eaa to your computer and use it in GitHub Desktop.
Drupal 8 test if on https page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Drupal 7 | |
global $is_https; | |
if ($is_https) { | |
// Do something | |
} | |
// Drupal 8 | |
if (Drupal::request()->isSecure()) { | |
// Do something | |
} | |
// Don't you ever | |
@$_SERVER['HTTPS'] != 'on' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment