Changeset 23187


Ignore:
Timestamp:
Jun 13, 2013, 8:41:32 PM (11 years ago)
Author:
rvelices
Message:

nicer urls when used over https

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_url.inc.php

    r19703 r23187  
    5252  if ($with_scheme)
    5353  {
     54    $is_https = false;
    5455    if (isset($_SERVER['HTTPS']) &&
    55         ((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1)))
    56     {
     56      ((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1)))
     57    {
     58      $is_https = true;
    5759      $url .= 'https://';
    5860    }
     
    6264    }
    6365    $url .= $_SERVER['HTTP_HOST'];
    64     if ($_SERVER['SERVER_PORT'] != 80)
     66    if ( (!$is_https && $_SERVER['SERVER_PORT'] != 80)
     67          ||($is_https && $_SERVER['SERVER_PORT'] != 443))
    6568    {
    6669      $url_port = ':'.$_SERVER['SERVER_PORT'];
Note: See TracChangeset for help on using the changeset viewer.