Skip to content
Snippets Groups Projects
Commit dfa3aaa0 authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

Merge pull request #4753 from nextcloud/fix-links-on-error-page

Fix escaped HTML on error pages
parents 684997f7 9309217e
No related branches found
No related tags found
No related merge requests found
...@@ -246,9 +246,8 @@ class OC { ...@@ -246,9 +246,8 @@ class OC {
} else { } else {
OC_Template::printErrorPage( OC_Template::printErrorPage(
$l->t('Cannot write into "config" directory!'), $l->t('Cannot write into "config" directory!'),
$l->t('This can usually be fixed by ' $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
. '%sgiving the webserver write access to the config directory%s.', [ $urlGenerator->linkToDocs('admin-dir_permissions') ])
array('<a href="' . $urlGenerator->linkToDocs('admin-dir_permissions') . '" target="_blank" rel="noreferrer">', '</a>'))
); );
} }
} }
......
...@@ -249,8 +249,7 @@ class Config { ...@@ -249,8 +249,7 @@ class Config {
$url = \OC::$server->getURLGenerator()->linkToDocs('admin-dir_permissions'); $url = \OC::$server->getURLGenerator()->linkToDocs('admin-dir_permissions');
throw new HintException( throw new HintException(
"Can't write into config directory!", "Can't write into config directory!",
'This can usually be fixed by ' 'This can usually be fixed by giving the webserver write access to the config directory. See ' . $url);
.'<a href="' . $url . '" target="_blank" rel="noreferrer">giving the webserver write access to the config directory</a>.');
} }
// Try to acquire a file lock // Try to acquire a file lock
......
...@@ -669,9 +669,8 @@ class OC_Util { ...@@ -669,9 +669,8 @@ class OC_Util {
if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) { if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
$errors[] = array( $errors[] = array(
'error' => $l->t('Cannot write into "config" directory'), 'error' => $l->t('Cannot write into "config" directory'),
'hint' => $l->t('This can usually be fixed by ' 'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
. '%sgiving the webserver write access to the config directory%s.', [$urlGenerator->linkToDocs('admin-dir_permissions')])
array('<a href="' . $urlGenerator->linkToDocs('admin-dir_permissions') . '" target="_blank" rel="noreferrer">', '</a>'))
); );
} }
} }
...@@ -684,10 +683,9 @@ class OC_Util { ...@@ -684,10 +683,9 @@ class OC_Util {
) { ) {
$errors[] = array( $errors[] = array(
'error' => $l->t('Cannot write into "apps" directory'), 'error' => $l->t('Cannot write into "apps" directory'),
'hint' => $l->t('This can usually be fixed by ' 'hint' => $l->t('This can usually be fixed by giving the webserver write access to the apps directory'
. '%sgiving the webserver write access to the apps directory%s' . ' or disabling the appstore in the config file. See %s',
. ' or disabling the appstore in the config file.', [$urlGenerator->linkToDocs('admin-dir_permissions')])
array('<a href="' . $urlGenerator->linkToDocs('admin-dir_permissions') . '" target="_blank" rel="noreferrer">', '</a>'))
); );
} }
} }
...@@ -700,16 +698,14 @@ class OC_Util { ...@@ -700,16 +698,14 @@ class OC_Util {
} else { } else {
$errors[] = [ $errors[] = [
'error' => $l->t('Cannot create "data" directory'), 'error' => $l->t('Cannot create "data" directory'),
'hint' => $l->t('This can usually be fixed by ' 'hint' => $l->t('This can usually be fixed by giving the webserver write access to the root directory. See %s',
. '<a href="%s" target="_blank" rel="noreferrer">giving the webserver write access to the root directory</a>.',
[$urlGenerator->linkToDocs('admin-dir_permissions')]) [$urlGenerator->linkToDocs('admin-dir_permissions')])
]; ];
} }
} else if (!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) { } else if (!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) {
//common hint for all file permissions error messages //common hint for all file permissions error messages
$permissionsHint = $l->t('Permissions can usually be fixed by ' $permissionsHint = $l->t('Permissions can usually be fixed by giving the webserver write access to the root directory. See %.',
. '%sgiving the webserver write access to the root directory%s.', [$urlGenerator->linkToDocs('admin-dir_permissions')]);
['<a href="' . $urlGenerator->linkToDocs('admin-dir_permissions') . '" target="_blank" rel="noreferrer">', '</a>']);
$errors[] = [ $errors[] = [
'error' => 'Your data directory is not writable', 'error' => 'Your data directory is not writable',
'hint' => $permissionsHint 'hint' => $permissionsHint
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment