Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redirect-handler
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
redirect-handler
Merge requests
!2
fix loop over config with missing regex section.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
fix loop over config with missing regex section.
add-docker
into
master
Overview
0
Commits
8
Pipelines
0
Changes
1
Merged
Hahn Axel (hahn)
requested to merge
add-docker
into
master
1 year ago
Overview
0
Commits
8
Pipelines
0
Changes
1
0
0
Merge request reports
Compare
master
version 5
7464a5f8
1 year ago
version 4
ff7434c4
1 year ago
version 3
b70c0d24
1 year ago
version 2
b5658186
1 year ago
version 1
a3dabf0a
1 year ago
master (base)
and
version 1
latest version
68d15ec1
8 commits,
1 year ago
version 5
7464a5f8
7 commits,
1 year ago
version 4
ff7434c4
5 commits,
1 year ago
version 3
b70c0d24
3 commits,
1 year ago
version 2
b5658186
2 commits,
1 year ago
version 1
a3dabf0a
1 commit,
1 year ago
1 file
+
9
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
public_html/classes/redirect.class.php
+
9
−
7
View file @ a3dabf0a
Edit in single-file editor
Open in Web IDE
Show full file
@@ -23,6 +23,7 @@
* 2019-04-25 v1.2 ah use REQUEST_URI (works on Win and Linux)
* 2020-05-06 v1.3 ah added aliases for multiple domains with the same config
* 2020-05-06 v1.4 ah rewrite as class
* 2023-08-28 v1.5 ah fix loop over config with missing regex section.
*/
/**
@@ -229,13 +230,14 @@ class redirect {
$aRedirect
=
$this
->
aConfig
[
'direct'
][
$this
->
sRequest
];
}
else
{
$this
->
_wd
(
"no direct match ... scanning regex"
);
foreach
(
array_keys
(
$this
->
aConfig
[
'regex'
])
as
$sRegex
)
{
$this
->
_wd
(
"check if regex [
$sRegex
] matches
$this->sRequest
"
);
if
(
preg_match
(
'#'
.
$sRegex
.
'#'
,
$this
->
sRequest
))
{
$this
->
_wd
(
"REGEX MATCH! aborting tests"
);
$aRedirect
=
$this
->
aConfig
[
'regex'
][
$sRegex
];
break
;
if
(
isset
(
$this
->
aConfig
[
'regex'
])
&&
is_array
(
$this
->
aConfig
[
'regex'
])){
foreach
(
array_keys
(
$this
->
aConfig
[
'regex'
])
as
$sRegex
)
{
$this
->
_wd
(
"check if regex [
$sRegex
] matches
$this->sRequest
"
);
if
(
preg_match
(
'#'
.
$sRegex
.
'#'
,
$this
->
sRequest
))
{
$this
->
_wd
(
"REGEX MATCH! aborting tests"
);
$aRedirect
=
$this
->
aConfig
[
'regex'
][
$sRegex
];
break
;
}
}
}
}
Loading