We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

2 fixes v1.0b5 to allow https on Centos 5.5 with Apache 2.2 & PHP 5.3.3 | Forum

Lloyd Merithew
Lloyd Merithew Nov 1 '10
1). ow_utilities/url.php

Change existing public static function self(Url() with:

public static function selfUrl()
{
$s = (!empty($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on") ) ? 's' : '';
$serverProtocol = strtolower($_SERVER["SERVER_PROTOCOL"]);
$protocol = substr($serverProtocol, 0, strpos($serverProtocol, '/')) . $s;

$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":" . $_SERVER["SERVER_PORT"]);
//This mod is to add back https to url
if ($_SERVER["HTTPS"] == "on")
{
return '' . $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
} else
{
return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
}
}

2). ow_core/application.php

Change existing public function redirect( $redirectTo = null ) with:

public function redirect( $redirectTo = null )
{
// if empty redirect location -> current URI is used
if ( $redirectTo === null )
{
$redirectTo = OW::getRequest()->getRequestUri();
}

// if URI is provided need to add site home URL

// my mod change '" to 'http'

if ( !strstr($redirectTo, 'http') )
{
$redirectTo = OW_URL_HOME . UTIL_String::removeFirstAndLastSlashes($redirectTo);
}

UTIL_Url::redirect($redirectTo);
}


Regards,
Lloyd