Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.217.150
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
owncloud-prm /
updater /
src /
Http /
Delete
Unzip
Name
Size
Permission
Date
Action
Request.php
2.97
KB
-rw-r--r--
2018-04-19 18:16
Save
Rename
<?php /** * @author Victor Dubiniuk <dubiniuk@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see <http://www.gnu.org/licenses/> * */ namespace Owncloud\Updater\Http; /** * Class Request * * @package Owncloud\Updater\Http */ class Request { protected $vars; /** * Request constructor. * * @param array $vars */ public function __construct($vars = []){ $this->vars = $vars; } /** * Returns the request uri * @return string */ public function getRequestUri() { return $this->server('REQUEST_URI'); } /** * @return string */ public function getServerProtocol() { $forwardedProto = $this->server('HTTP_X_FORWARDED_PROTO'); if (!is_null($forwardedProto)) { $proto = strtolower($this->getPartBeforeComma($forwardedProto)); // Verify that the protocol is always HTTP or HTTPS // default to http if an invalid value is provided return $proto === 'https' ? 'https' : 'http'; } $isHttps = $this->server('HTTPS'); if ($isHttps !== null && $isHttps !== 'off' && $isHttps !== '' ) { return 'https'; } return 'http'; } /** * @return mixed|string */ public function getHost(){ $host = 'localhost'; $forwardedHost = $this->server('HTTP_X_FORWARDED_HOST'); if (!is_null($forwardedHost)) { $host = $this->getPartBeforeComma($forwardedHost); } else { $httpHost = $this->server('HTTP_HOST'); if (is_null($httpHost)) { $serverName = $this->server('SERVER_NAME'); if (!is_null($serverName)){ $host = $serverName; } } else { $host = $httpHost; } } return $host; } /** * @param string $name * @return mixed */ public function postParameter($name){ return isset($this->vars['post'][$name]) ? $this->vars['post'][$name] : null; } /** * @param string $name * @return mixed */ public function header($name) { $name = strtoupper($name); return $this->server('HTTP_'.$name); } /** * @param string $name * @return mixed */ public function server($name){ return isset($this->vars['headers'][$name]) ? $this->vars['headers'][$name] : null; } /** * Return first part before comma or the string itself if there is no comma * @param string $str * @return string */ private function getPartBeforeComma($str){ if (strpos($str, ',') !== false) { $parts = explode(',', $str); $result = $parts[0]; } else { $result = $str; } return trim($result); } }