Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
0db311c9
Commit
0db311c9
authored
9 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Only update the htaccess ErrorDocument links when they are not set yet
parent
4b532434
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/setup.php
+14
-4
14 additions, 4 deletions
lib/private/setup.php
with
14 additions
and
4 deletions
lib/private/setup.php
+
14
−
4
View file @
0db311c9
...
@@ -402,10 +402,20 @@ class Setup {
...
@@ -402,10 +402,20 @@ class Setup {
throw
new
\OC\HintException
(
'.htaccess file has the wrong version. Please upload the correct version. Maybe you forgot to replace it after updating?'
);
throw
new
\OC\HintException
(
'.htaccess file has the wrong version. Please upload the correct version. Maybe you forgot to replace it after updating?'
);
}
}
$content
=
"
\n
"
;
$htaccessContent
=
file_get_contents
(
$setupHelper
->
pathToHtaccess
());
$content
.
=
"ErrorDocument 403 "
.
\OC
::
$WEBROOT
.
"/core/templates/403.php
\n
"
;
//custom 403 error page
$content
=
''
;
$content
.
=
"ErrorDocument 404 "
.
\OC
::
$WEBROOT
.
"/core/templates/404.php"
;
//custom 404 error page
if
(
strpos
(
$htaccessContent
,
'ErrorDocument 403'
)
===
false
)
{
@
file_put_contents
(
$setupHelper
->
pathToHtaccess
(),
$content
,
FILE_APPEND
);
//suppress errors in case we don't have permissions for it
//custom 403 error page
$content
.
=
"
\n
ErrorDocument 403 "
.
\OC
::
$WEBROOT
.
"/core/templates/403.php"
;
}
if
(
strpos
(
$htaccessContent
,
'ErrorDocument 404'
)
===
false
)
{
//custom 404 error page
$content
.
=
"
\n
ErrorDocument 404 "
.
\OC
::
$WEBROOT
.
"/core/templates/404.php"
;
}
if
(
$content
!==
''
)
{
//suppress errors in case we don't have permissions for it
@
file_put_contents
(
$setupHelper
->
pathToHtaccess
(),
$content
.
"
\n
"
,
FILE_APPEND
);
}
}
}
public
static
function
protectDataDirectory
()
{
public
static
function
protectDataDirectory
()
{
...
...
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