Ticket #1486411: force_https.patch

File force_https.patch, 646 bytes (added by nicklaus.little, 3 years ago)

Patch file

  • index.php

    a b  
    6767if (empty($_SESSION['user_id']) && ($force_https = $RCMAIL->config->get('force_https', false))) { 
    6868  $https_port = is_bool($force_https) ? 443 : $force_https; 
    6969  if (!rcube_https_check($https_port)) { 
    70     header('Location: https://' . $_SERVER['HTTP_HOST'] . ($https_port != 443 ? ':' . $https_port : '') . $_SERVER['REQUEST_URI']); 
     70    header('Location: https://' . preg_replace('/^([^:]+).*$/', '$1', $_SERVER['HTTP_HOST']) . ($https_port != 443 ? ':' . $https_port : '') . $_SERVER['REQUEST_URI']); 
    7171    exit; 
    7272  } 
    7373}