]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix escaped HTML on error pages 4753/head
authorMorris Jobke <hey@morrisjobke.de>
Tue, 9 May 2017 02:16:08 +0000 (21:16 -0500)
committerMorris Jobke <hey@morrisjobke.de>
Tue, 9 May 2017 02:16:08 +0000 (21:16 -0500)
* fixes #4655

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
lib/base.php
lib/private/Config.php
lib/private/legacy/util.php

index 41e4ef9573c8cf66b712002ec50642c5986f62a4..69ea6e54c2d5b89989d13fa4d3f35d61121b3240 100644 (file)
@@ -246,9 +246,8 @@ class OC {
                        } else {
                                OC_Template::printErrorPage(
                                        $l->t('Cannot write into "config" directory!'),
-                                       $l->t('This can usually be fixed by '
-                                       . '%sgiving the webserver write access to the config directory%s.',
-                                        array('<a href="' . $urlGenerator->linkToDocs('admin-dir_permissions') . '" target="_blank" rel="noreferrer">', '</a>'))
+                                       $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
+                                        [ $urlGenerator->linkToDocs('admin-dir_permissions') ])
                                );
                        }
                }
index f15854b611384bacabaf34f09713ad280a4235f7..b4fe9e03d23dbdba6b65019cb6e1e816f9e1273c 100644 (file)
@@ -249,8 +249,7 @@ class Config {
                        $url = \OC::$server->getURLGenerator()->linkToDocs('admin-dir_permissions');
                        throw new HintException(
                                "Can't write into config directory!",
-                               'This can usually be fixed by '
-                               .'<a href="' . $url . '" target="_blank" rel="noreferrer">giving the webserver write access to the config directory</a>.');
+                               'This can usually be fixed by giving the webserver write access to the config directory. See ' . $url);
                }
 
                // Try to acquire a file lock
index d49599cb8a1594de3dc802f99f2b74ee6e52be58..7750e84f065ebea6000860f81f6de9b40dfebd53 100644 (file)
@@ -669,9 +669,8 @@ class OC_Util {
                        if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
                                $errors[] = array(
                                        'error' => $l->t('Cannot write into "config" directory'),
-                                       'hint' => $l->t('This can usually be fixed by '
-                                               . '%sgiving the webserver write access to the config directory%s.',
-                                               array('<a href="' . $urlGenerator->linkToDocs('admin-dir_permissions') . '" target="_blank" rel="noreferrer">', '</a>'))
+                                       'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
+                                               [$urlGenerator->linkToDocs('admin-dir_permissions')])
                                );
                        }
                }
@@ -684,10 +683,9 @@ class OC_Util {
                        ) {
                                $errors[] = array(
                                        'error' => $l->t('Cannot write into "apps" directory'),
-                                       'hint' => $l->t('This can usually be fixed by '
-                                               . '%sgiving the webserver write access to the apps directory%s'
-                                               . ' or disabling the appstore in the config file.',
-                                               array('<a href="' . $urlGenerator->linkToDocs('admin-dir_permissions') . '" target="_blank" rel="noreferrer">', '</a>'))
+                                       'hint' => $l->t('This can usually be fixed by giving the webserver write access to the apps directory'
+                                               . ' or disabling the appstore in the config file. See %s',
+                                               [$urlGenerator->linkToDocs('admin-dir_permissions')])
                                );
                        }
                }
@@ -700,16 +698,14 @@ class OC_Util {
                                } else {
                                        $errors[] = [
                                                'error' => $l->t('Cannot create "data" directory'),
-                                               'hint' => $l->t('This can usually be fixed by '
-                                                       . '<a href="%s" target="_blank" rel="noreferrer">giving the webserver write access to the root directory</a>.',
+                                               'hint' => $l->t('This can usually be fixed by giving the webserver write access to the root directory. See %s',
                                                        [$urlGenerator->linkToDocs('admin-dir_permissions')])
                                        ];
                                }
                        } else if (!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) {
                                //common hint for all file permissions error messages
-                               $permissionsHint = $l->t('Permissions can usually be fixed by '
-                                       . '%sgiving the webserver write access to the root directory%s.',
-                                       ['<a href="' . $urlGenerator->linkToDocs('admin-dir_permissions') . '" target="_blank" rel="noreferrer">', '</a>']);
+                               $permissionsHint = $l->t('Permissions can usually be fixed by giving the webserver write access to the root directory. See %.',
+                                       [$urlGenerator->linkToDocs('admin-dir_permissions')]);
                                $errors[] = [
                                        'error' => 'Your data directory is not writable',
                                        'hint' => $permissionsHint