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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
redirect-handler
Commits
b70c0d24
Commit
b70c0d24
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
remove php warning if there is no config yet
parent
b5658186
No related branches found
No related tags found
1 merge request
!2
fix loop over config with missing regex section.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public_html/classes/redirect.admin.class.php
+17
-14
17 additions, 14 deletions
public_html/classes/redirect.admin.class.php
with
17 additions
and
14 deletions
public_html/classes/redirect.admin.class.php
+
17
−
14
View file @
b70c0d24
...
...
@@ -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
;
}
}
}
}
...
...
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