New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
html tags are displayed in permission error message #12300
Comments
Not sure but maybe this would fix it: diff --git a/core/Filesystem.php b/core/Filesystem.php
index 7fbd63b..f1a2a8a 100644
--- a/core/Filesystem.php
+++ b/core/Filesystem.php
@@ -10,6 +10,7 @@ namespace Piwik;
use Exception;
use Piwik\Container\StaticContainer;
+use Piwik\Exception\MissingFilePermissionException;
use Piwik\Plugins\Installation\ServerFilesGenerator;
use Piwik\Tracker\Cache as TrackerCache;
use Piwik\Cache as PiwikCache;
@@ -502,7 +503,9 @@ class Filesystem
if (!@copy($source, $dest)) {
$message = "Error while creating/copying file to <code>$dest</code>. <br />"
. Filechecks::getErrorMessageMissingPermissions(self::getPathToPiwikRoot());
- throw new Exception($message);
+ $exception = new MissingFilePermissionException($message);
+ $exception->setIsHtmlMessage();
+ throw $exception;
}
} |
I tried this out (by adding a failing copy to a plugins Systemsettings init) and while this fixes the error when it appears via HTML The request to
In addition the notification disappears after a few seconds. Pushed change to https://github.com/matomo-org/matomo/tree/escape-copy-permission-error |
The JavaScript currently directly uses the response from API to create the notification in https://github.com/matomo-org/matomo/blob/3.x-dev/plugins/CoreHome/angularjs/common/services/piwik-api.js#L63-L77 |
related to #10369
I tried to update a plugin but forgot to change the owner of the folder back to
ẁww-data
before, so Piwik couldn't create a file.But the error message isn't displayed correctly:
The text was updated successfully, but these errors were encountered: