mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
#869 installController::checkRewriteUsable() modified to support HTTPS
This commit is contained in:
parent
2c66e6786c
commit
16c2694c19
1 changed files with 13 additions and 13 deletions
|
|
@ -388,26 +388,26 @@ class installController extends install
|
|||
|
||||
FileHandler::writeFile(_XE_PATH_.$checkFilePath, trim($checkString));
|
||||
|
||||
$scheme = $_SERVER['REQUEST_SCHEME'];
|
||||
$hostname = $_SERVER['SERVER_NAME'];
|
||||
$port = $_SERVER['SERVER_PORT'];
|
||||
$str_port = '';
|
||||
if($port)
|
||||
{
|
||||
$str_port = ':' . $port;
|
||||
}
|
||||
|
||||
$query = "/JUST/CHECK/REWRITE/" . $checkFilePath;
|
||||
$currentPath = str_replace($_SERVER['DOCUMENT_ROOT'], "", _XE_PATH_);
|
||||
if($currentPath != "")
|
||||
{
|
||||
$query = $currentPath . $query;
|
||||
|
||||
$fp = @fsockopen($hostname, $port, $errno, $errstr, 5);
|
||||
if(!$fp) return false;
|
||||
|
||||
fputs($fp, "GET {$query} HTTP/1.0\r\n");
|
||||
fputs($fp, "Host: {$hostname}\r\n\r\n");
|
||||
|
||||
$buff = '';
|
||||
while(!feof($fp)) {
|
||||
$str = fgets($fp, 1024);
|
||||
if(trim($str)=='') $start = true;
|
||||
if($start) $buff .= $str;
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
$requestUrl = sprintf('%s://%s%s%s', $scheme, $hostname, $str_port, $query);
|
||||
$requestConfig = array();
|
||||
$requestConfig['ssl_verify_peer'] = false;
|
||||
$buff = FileHandler::getRemoteResource($requestUrl, null, 10, 'POST', 'application/x-www-form-urlencoded', array(), array(), array(), $requestConfig);
|
||||
|
||||
FileHandler::removeFile(_XE_PATH_.$checkFilePath);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue