@@ -4,7 +4,7 @@ |
||
| 4 | 4 | /** |
| 5 | 5 | * 文件 |
| 6 | 6 | */ |
| 7 | -class File extends \SplFileInfo { |
|
| 7 | +class File extends \SplFileInfo { |
|
| 8 | 8 | /** |
| 9 | 9 | * 创建文件 |
| 10 | 10 | * |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | parse_str($query, $this->query); |
| 44 | 44 | } |
| 45 | 45 | $url = parse_url($url, PHP_URL_PATH); |
| 46 | - $this->uri = '/' . trim($url, '\/'); |
|
| 46 | + $this->uri = '/'.trim($url, '\/'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function getQuery():array |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | if (\strpos($url, $indexFile) === 0) { |
| 65 | 65 | // for /index.php/ |
| 66 | - $url = \substr($url, strlen($indexFile));// for /index.php?/ |
|
| 66 | + $url = \substr($url, strlen($indexFile)); // for /index.php?/ |
|
| 67 | 67 | if (\strpos($url, '?/') === 0) { |
| 68 | 68 | $url = ltrim($url, '?'); |
| 69 | 69 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * HTTP请求文件 |
| 9 | 9 | */ |
| 10 | -class UploadedFile extends File { |
|
| 10 | +class UploadedFile extends File { |
|
| 11 | 11 | |
| 12 | 12 | private $originalName; |
| 13 | 13 | private $mimeType; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | private function filterRemoteAddr():string |
| 104 | 104 | { |
| 105 | - static $ipFrom = ['HTTP_CLIENT_IP','HTTP_X_FORWARDED_FOR','HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP','HTTP_FORWARDED_FOR','HTTP_FORWARDED','REMOTE_ADDR']; |
|
| 105 | + static $ipFrom = ['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR']; |
|
| 106 | 106 | foreach ($ipFrom as $key) { |
| 107 | 107 | if (array_key_exists($key, $_SERVER)) { |
| 108 | 108 | foreach (explode(',', $_SERVER[$key]) as $ip) { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | if (array_key_exists('SERVER_PORT', $_SERVER)) { |
| 144 | 144 | return $_SERVER['SERVER_PORT']; |
| 145 | 145 | } |
| 146 | - return $this->getSecure()?443:80; |
|
| 146 | + return $this->getSecure() ? 443 : 80; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |