Skip to content

Commit a46e256

Browse files
committed
Update WorkermanServer.php
1 parent 2af7405 commit a46e256

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Ubiquity/servers/workerman/WorkermanServer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function handle(ConnectionInterface $connection, $datas) {
122122
// $_REQUEST['REQUEST_TIME_FLOAT']=\microtime(true);
123123
Http::header('Date: ' . \gmdate('D, d M Y H:i:s') . ' GMT');
124124
$_GET['c'] = '';
125-
$uriInfos = (self::$uriInfos[$_SERVER['REQUEST_URI']] ??= self::parseURI($_SERVER['REQUEST_URI']));
125+
$uriInfos = (self::$uriInfos[$_SERVER['REQUEST_URI']] ??= self::parseURI($_SERVER['REQUEST_URI'], $this->basedir));
126126
$uri = $uriInfos['uri'];
127127
if ($uriInfos['isAction']) {
128128
$_GET['c'] = $uri;
@@ -143,9 +143,9 @@ protected function handle(ConnectionInterface $connection, $datas) {
143143
return $connection->send(\ob_get_clean());
144144
}
145145

146-
protected static function parseURI($requestURI) {
146+
protected static function parseURI($requestURI, $basedir) {
147147
$uri = \ltrim(\urldecode(\parse_url($requestURI, PHP_URL_PATH)), '/');
148-
$isAction = ($uri == null || ! ($fe = \file_exists($this->basedir . '/../' . $uri))) && ($uri != 'favicon.ico');
148+
$isAction = ($uri == null || ! ($fe = \file_exists($basedir . '/../' . $uri))) && ($uri != 'favicon.ico');
149149
return [
150150
'uri' => $uri,
151151
'isAction' => $isAction,

0 commit comments

Comments
 (0)