Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
BRIC
dokuwiki
Commits
e82e3526
Commit
e82e3526
authored
19 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
fixed handling of non standard ports
darcs-hash:20050907213543-7ad00-c411e9f5788bf2629ba8529c46d7247aff1a2305.gz
parent
df45e1b4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/init.php
+8
-5
8 additions, 5 deletions
inc/init.php
with
8 additions
and
5 deletions
inc/init.php
+
8
−
5
View file @
e82e3526
...
...
@@ -176,24 +176,27 @@ function getBaseURL($abs=false){
//finish here for relative URLs
if
(
!
$abs
)
return
$dir
;
$port
=
':'
.
$_SERVER
[
'SERVER_PORT'
];
//remove port from hostheader as sent by IE
$host
=
preg_replace
(
'/:.*$/'
,
''
,
$_SERVER
[
'HTTP_HOST'
]);
//split hostheader into host and port
list
(
$host
,
$port
)
=
explode
(
':'
,
$_SERVER
[
'HTTP_HOST'
]);
if
(
!
$port
)
$port
=
$_SERVER
[
'SERVER_PORT'
];
if
(
!
$port
)
$port
=
80
;
// see if HTTPS is enabled - apache leaves this empty when not available,
// IIS sets it to 'off', 'false' and 'disabled' are just guessing
if
(
preg_match
(
'/^(|off|false|disabled)$/i'
,
$_SERVER
[
'HTTPS'
])){
$proto
=
'http://'
;
if
(
$
_SERVER
[
'SERVER_PORT'
]
==
'80'
)
{
if
(
$
port
==
'80'
)
{
$port
=
''
;
}
}
else
{
$proto
=
'https://'
;
if
(
$
_SERVER
[
'SERVER_PORT'
]
==
'443'
)
{
if
(
$
port
==
'443'
)
{
$port
=
''
;
}
}
if
(
$port
)
$port
=
':'
.
$port
;
return
$proto
.
$host
.
$port
.
$dir
;
}
...
...
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