Ticket #6798: 6798.diff

File 6798.diff, 681 bytes (added by Joe Ripley <vitaminjoe@…>, 10 years ago)

Fix PHP error message in web server logs

  • mythplugins/mythweb/includes/defines.php

     
    8787
    8888    define('http_host', isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']);
    8989
    90     list($host, $port) = explode(':', http_host);
     90    if (strpos(http_host, ':')) {
     91        list($host, $port) = explode(':', http_host);
     92    }
     93    else {
     94        $host = http_host;
     95        $port = null;
     96    }
    9197
    9298    $_SERVER['HTTP_HOST'] = $host;
    9399    $_SERVER['HTTP_PORT'] = $port;