Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pablo Rauzy
cigala
Commits
6f4b072d
Commit
6f4b072d
authored
Mar 21, 2021
by
Pablo Rauzy
Browse files
add protocol in url
parent
ec990564
Changes
1
Show whitespace changes
Inline
Side-by-side
root/cigala.php
View file @
6f4b072d
...
...
@@ -55,20 +55,21 @@ if (isset($_GET['logout']) || !isset($_SESSION['user'])) {
}
// Finalize config
$cigala_url
=
'//'
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'SCRIPT_NAME'
];
if
(
!
isset
(
$_SERVER
[
'REQUEST_SCHEME'
]))
{
$_SERVER
[
'REQUEST_SCHEME'
]
=
'http'
.
(
isset
(
$_SERVER
[
'HTTPS'
])
&&
$_SERVER
[
'HTTPS'
]
!=
'off'
?
's'
:
''
);
}
$cigala_url
=
$_SERVER
[
'REQUEST_SCHEME'
]
.
'://'
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'SCRIPT_NAME'
];
if
(
$config
[
'multidomain'
])
{
$login
=
SQLite3
::
escapeString
(
str_replace
(
'..'
,
''
,
$_SESSION
[
'user'
]));
list
(
$name
,
$domain
,
$tld
)
=
explode
(
'.'
,
$login
,
3
);
$config
[
'home'
]
=
str_replace
(
'%DOMAIN%'
,
$domain
,
$config
[
'home'
])
.
$name
;
$config
[
'deleted'
]
=
str_replace
(
'%DOMAIN%'
,
$domain
,
$config
[
'deleted'
])
.
$name
;
$config
[
'url'
]
=
'
//'
.
$login
.
'/'
;
$config
[
'url'
]
=
$_SERVER
[
'REQUEST_SCHEME'
]
.
':
//'
.
$login
.
'/'
;
}
else
{
$name
=
$login
=
SQLite3
::
escapeString
(
str_replace
(
'..'
,
''
,
$_SESSION
[
'user'
]));
if
(
!
$config
[
'singleuser'
])
{
$config
[
'home'
]
.
=
$name
;
$config
[
'deleted'
]
.
=
$name
;
$config
[
'url'
]
=
'
//'
.
$name
.
'.'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/'
;
$config
[
'url'
]
=
$_SERVER
[
'REQUEST_SCHEME'
]
.
':
//'
.
$name
.
'.'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/'
;
}
else
{
$config
[
'url'
]
=
dirname
(
$cigala_url
)
.
'/'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment