Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
99216444
Commit
99216444
authored
10 years ago
by
Lukas Reschke
Browse files
Options
Downloads
Patches
Plain Diff
Add blackmagic due to cyclic dependency
parent
9f91d649
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/base.php
+8
-1
8 additions, 1 deletion
lib/base.php
lib/private/appframework/http/request.php
+3
-3
3 additions, 3 deletions
lib/private/appframework/http/request.php
with
11 additions
and
4 deletions
lib/base.php
+
8
−
1
View file @
99216444
...
...
@@ -104,7 +104,14 @@ class OC {
* FIXME: The following line is required because of a cyclic dependency
* on IRequest.
*/
$scriptName
=
$_SERVER
[
'SCRIPT_NAME'
];
$params
=
[
'server'
=>
[
'SCRIPT_NAME'
=>
$_SERVER
[
'SCRIPT_NAME'
],
'SCRIPT_FILENAME'
=>
$_SERVER
[
'SCRIPT_FILENAME'
],
],
];
$fakeRequest
=
new
\OC\AppFramework\Http\Request
(
$params
,
null
,
new
\OC\AllConfig
(
new
\OC\SystemConfig
()));
$scriptName
=
$fakeRequest
->
getScriptName
();
if
(
substr
(
$scriptName
,
-
1
)
==
'/'
)
{
$scriptName
.
=
'index.php'
;
//make sure suburi follows the same rules as scriptName
...
...
This diff is collapsed.
Click to expand it.
lib/private/appframework/http/request.php
+
3
−
3
View file @
99216444
...
...
@@ -80,7 +80,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
* @see http://www.php.net/manual/en/reserved.variables.php
*/
public
function
__construct
(
array
$vars
=
array
(),
ISecureRandom
$secureRandom
,
ISecureRandom
$secureRandom
=
null
,
IConfig
$config
,
$stream
=
'php://input'
)
{
$this
->
inputStream
=
$stream
;
...
...
@@ -596,8 +596,8 @@ class Request implements \ArrayAccess, \Countable, IRequest {
$name
=
$this
->
server
[
'SCRIPT_NAME'
];
$overwriteWebRoot
=
$this
->
config
->
getSystemValue
(
'overwritewebroot'
);
if
(
$overwriteWebRoot
!==
''
&&
$this
->
isOverwriteCondition
())
{
// FIXME: This code is untestable due to __
_
DIR__
$serverRoot
=
str_replace
(
'\\'
,
'/'
,
substr
(
__DIR__
,
0
,
-
strlen
(
'lib/private/'
)));
// FIXME: This code is untestable due to __DIR__
, also that hardcoded path is really dangerous
$serverRoot
=
str_replace
(
'\\'
,
'/'
,
substr
(
__DIR__
,
0
,
-
strlen
(
'lib/private/
appframework/http/
'
)));
$suburi
=
str_replace
(
'\\'
,
'/'
,
substr
(
realpath
(
$this
->
server
[
'SCRIPT_FILENAME'
]),
strlen
(
$serverRoot
)));
$name
=
'/'
.
ltrim
(
$overwriteWebRoot
.
$suburi
,
'/'
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment