Diff for phpPlatonLib/Platon/Platon.php between version 1.26 and 1.27
| version 1.26, 2004/12/12 21:50:18 |
version 1.27, 2004/12/13 10:23:54 |
|
|
| * @access public |
* @access public |
| */ |
*/ |
| |
|
| /* $Platon: phpPlatonLib/Platon/Platon.php,v 1.25 2004/12/12 21:44:55 nepto Exp $ */ |
/* $Platon: phpPlatonLib/Platon/Platon.php,v 1.26 2004/12/12 21:50:18 nepto Exp $ */ |
| |
|
| class Platon |
class Platon |
| { |
{ |
|
|
| } |
} |
| exit; |
exit; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
/** |
| |
* Changes a HTTP host using permanent redirect |
| |
* |
| |
* @param string $new_http_host destination HTTP host |
| |
* @param string $old_http_host source HTTP host (string or array) |
| |
* empty string means any host |
| |
*/ |
| |
function redirect_change_host($new_http_host, $old_http_host = '') /* {{{ */ |
| |
{ |
| |
if (strlen($_SERVER['HTTP_HOST']) <= 0) { |
| |
return; |
| |
} |
| |
if (! strcasecmp($new_http_host, $_SERVER['HTTP_HOST'])) { |
| |
return; |
| |
} |
| |
if (is_array($old_http_host)) { |
| |
foreach ($old_http_host as $http_host) { |
| |
Platon::redirect_change_host($new_http_host, $old_http_host); |
| |
} |
| |
return; |
| |
} |
| |
if (strlen($old_http_host) > 0) { |
| |
if (strcasecmp($old_http_host, $_SERVER['HTTP_HOST'])) { |
| |
return; |
| |
} |
| |
} |
| |
$schema = strcasecmp($_SERVER['HTTPS'], 'on') ? 'http' : 'https'; |
| |
$request_uri = $_SERVER['REQUEST_URI']; |
| |
return Platon::redirect("$schema://$new_http_host$request_uri"); |
| |
} /* }}} */ |
| |
|
| /** |
/** |
| * Redirects if it is neccessary for particular file. |
* Redirects if it is neccessary for particular file. |
Platon Group <platon@platon.org> http://platon.org/
|
|