Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3338541
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3338541
Commits
74d9b41e
Commit
74d9b41e
authored
7 years ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2929198
by alexpott: .ht.router.php does not support update.php
parent
399e0b80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.ht.router.php
+22
-6
22 additions, 6 deletions
.ht.router.php
with
22 additions
and
6 deletions
.ht.router.php
+
22
−
6
View file @
74d9b41e
...
...
@@ -30,10 +30,26 @@
return
FALSE
;
}
// The use of a router script means that a number of $_SERVER variables have to
// be updated to point to the index-file.
$index_file_absolute
=
$_SERVER
[
'DOCUMENT_ROOT'
]
.
DIRECTORY_SEPARATOR
.
'index.php'
;
$index_file_relative
=
DIRECTORY_SEPARATOR
.
'index.php'
;
// Work around the PHP bug.
$path
=
$url
[
'path'
];
$script
=
'index.php'
;
if
(
strpos
(
$path
,
'.php'
)
!==
FALSE
)
{
// Work backwards through the path to check if a script exists. Otherwise
// fallback to index.php.
do
{
$path
=
dirname
(
$path
);
if
(
preg_match
(
'/\.php$/'
,
$path
)
&&
is_file
(
'.'
.
$path
))
{
// Discovered that the path contains an existing PHP file. Use that as the
// script to include.
$script
=
ltrim
(
$path
,
'/'
);
break
;
}
}
while
(
$path
!==
'/'
&&
$path
!==
'.'
);
}
// Update $_SERVER variables to point to the correct index-file.
$index_file_absolute
=
$_SERVER
[
'DOCUMENT_ROOT'
]
.
DIRECTORY_SEPARATOR
.
$script
;
$index_file_relative
=
DIRECTORY_SEPARATOR
.
$script
;
// SCRIPT_FILENAME will point to the router script itself, it should point to
// the full path of index.php.
...
...
@@ -45,5 +61,5 @@
$_SERVER
[
'SCRIPT_NAME'
]
=
$index_file_relative
;
$_SERVER
[
'PHP_SELF'
]
=
$index_file_relative
;
// Require the
main index.php
and let core take over.
require
$
index_file_absolute
;
// Require the
script
and let core take over.
require
$
_SERVER
[
'SCRIPT_FILENAME'
]
;
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