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
Viewing commit
b70c0d24
Prev
Next
Show latest version
1 file
+
17
−
14
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b70c0d24
remove php warning if there is no config yet
· b70c0d24
Hahn Axel (hahn)
authored
1 year ago
public_html/classes/redirect.admin.class.php
+
17
−
14
View file @ b70c0d24
Edit in single-file editor
Open in Web IDE
Show full file
@@ -17,6 +17,7 @@ require_once 'redirect.class.php';
* 2022-02-03 v1.5 ah add method isEnabled
* 2022-05-23 v1.6 ah add http head check+render output;
* 2022-05-31 v1.7 ah optical changes
* 2023-08-28 v1.8 ah remove php warning if there is no config yet
*/
/**
@@ -149,21 +150,23 @@ class redirectadmin extends redirect {
}
}
$aAliases
=
$this
->
_getAliases
();
foreach
(
$aAliases
as
$sAlias
=>
$sConfig
){
if
(
isset
(
$aReturn
[
$sAlias
])){
$aErrors
[]
=
"alias.json: A configuration for alias [
$sAlias
] is useless. There exists a file redirects_
{
$sAlias
}
.json (which has priority)."
;
}
else
{
if
(
!
isset
(
$aReturn
[
$sConfig
])){
$aErrors
[]
=
"alias.json: [
$sAlias
] points to a non existing host [
$sConfig
] - a file redirects_
$sConfig
.yml does not exist."
;
if
(
is_array
(
$aAliases
)
&&
count
(
$aAliases
)){
foreach
(
$aAliases
as
$sAlias
=>
$sConfig
){
if
(
isset
(
$aReturn
[
$sAlias
])){
$aErrors
[]
=
"alias.json: A configuration for alias [
$sAlias
] is useless. There exists a file redirects_
{
$sAlias
}
.json (which has priority)."
;
}
else
{
$aReturn
[
$sConfig
][
'aliases'
][]
=
$sAlias
;
$aReturn
[
$sAlias
]
=
array
(
'type'
=>
'alias'
,
'target'
=>
$sConfig
,
'ip'
=>
$this
->
_getIp
(
$sAlias
),
);
if
(
!
$aReturn
[
$sAlias
][
'ip'
]){
$aErrors
[]
=
'alias.json: The hostname was not found in DNS: '
.
$sAlias
;
if
(
!
isset
(
$aReturn
[
$sConfig
])){
$aErrors
[]
=
"alias.json: [
$sAlias
] points to a non existing host [
$sConfig
] - a file redirects_
$sConfig
.yml does not exist."
;
}
else
{
$aReturn
[
$sConfig
][
'aliases'
][]
=
$sAlias
;
$aReturn
[
$sAlias
]
=
array
(
'type'
=>
'alias'
,
'target'
=>
$sConfig
,
'ip'
=>
$this
->
_getIp
(
$sAlias
),
);
if
(
!
$aReturn
[
$sAlias
][
'ip'
]){
$aErrors
[]
=
'alias.json: The hostname was not found in DNS: '
.
$sAlias
;
}
}
}
}
Loading