Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UNL-CMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
UNL Information Services
UNL-CMS
Commits
6b896f70
Commit
6b896f70
authored
12 years ago
by
Eric Rasmussen
Browse files
Options
Downloads
Patches
Plain Diff
[gh-582] Whitespace
parent
9f92bbf0
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
includes/unl_bootstrap.inc
+12
-11
12 additions, 11 deletions
includes/unl_bootstrap.inc
with
12 additions
and
11 deletions
includes/unl_bootstrap.inc
+
12
−
11
View file @
6b896f70
...
...
@@ -19,24 +19,25 @@ function unl_bootstrap_short_hostname_redirect() {
if
(
PHP_SAPI
==
'cli'
)
{
return
;
}
$hostname
=
$_SERVER
[
'HTTP_HOST'
];
if
(
gethostbynamel
(
$hostname
))
{
// The provided host name is just fine.
return
;
}
// Otherwise, try adding .unl.edu.
$hostname
.
=
'.unl.edu'
;
if
(
gethostbynamel
(
$hostname
))
{
// If its a valid domain, redirect to it.
if
(
isset
(
$_SERVER
[
'HTTPS'
])
&&
$_SERVER
[
'HTTPS'
]
==
'on'
)
{
$uri
=
'https://'
;
}
else
{
}
else
{
$uri
=
'http://'
;
}
$uri
.
=
$hostname
.
$_SERVER
[
'REQUEST_URI'
];
header
(
'Location: '
.
$uri
);
exit
;
}
...
...
@@ -49,7 +50,7 @@ function unl_bootstrap_short_hostname_redirect() {
function
unl_bootstrap_multisite_without_symlinks
()
{
$original_script_name
=
$_SERVER
[
'SCRIPT_NAME'
];
$php_file
=
basename
(
$original_script_name
);
$request_uri
=
parse_url
(
$_SERVER
[
'REQUEST_URI'
]);
$path_parts
=
explode
(
'/'
,
$request_uri
[
'path'
]);
foreach
(
$path_parts
as
$path_index
=>
$path_part
)
{
...
...
@@ -57,7 +58,7 @@ function unl_bootstrap_multisite_without_symlinks() {
unset
(
$path_parts
[
$path_index
]);
}
}
$previous_conf_path
=
''
;
$previous_script_name
=
''
;
for
(
$i
=
count
(
$path_parts
);
$i
>=
0
;
$i
--
)
{
...
...
@@ -68,19 +69,19 @@ function unl_bootstrap_multisite_without_symlinks() {
$_SERVER
[
'SCRIPT_NAME'
]
=
'/'
.
implode
(
'/'
,
array_slice
(
$path_parts
,
0
,
$i
))
.
'/'
.
$php_file
;
}
$conf_path
=
conf_path
(
TRUE
,
TRUE
);
if
(
$previous_conf_path
&&
(
$conf_path
!=
$previous_conf_path
))
{
$_SERVER
[
'SCRIPT_NAME'
]
=
$previous_script_name
;
break
;
}
if
(
$_SERVER
[
'SCRIPT_NAME'
]
==
$original_script_name
)
{
break
;
}
$previous_conf_path
=
$conf_path
;
$previous_script_name
=
$_SERVER
[
'SCRIPT_NAME'
];
}
conf_path
(
TRUE
,
TRUE
);
}
...
...
@@ -118,7 +119,7 @@ function unl_bootstrap_is_mobile_user() {
// If Varnish set the X-UNL-Mobile header, use it instead of checking again.
return
$_SERVER
[
'X-UNL-Mobile'
]
==
'Yes'
;
}
if
(
!
isset
(
$_SERVER
[
'HTTP_ACCEPT'
],
$_SERVER
[
'HTTP_USER_AGENT'
]))
{
// We have no vars to check
return
false
;
...
...
@@ -129,7 +130,7 @@ function unl_bootstrap_is_mobile_user() {
// The user has a cookie set, requesting no mobile views
return
false
;
}
if
(
// Check the http_accept and user agent and see
preg_match
(
'/text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml/i'
,
$_SERVER
[
'HTTP_ACCEPT'
])
||
...
...
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