Skip to content
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

fix(theming): fix incorrectly inverted favicons #44119

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/theming/lib/IconBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
$appIconContent = $appIcon->getContent();
$mime = $appIcon->getMimeType();
} else {
$appIconContent = file_get_contents($appIcon);

Check failure on line 137 in apps/theming/lib/IconBuilder.php

View workflow job for this annotation

GitHub Actions / static-code-analysis-security

TaintedFile

apps/theming/lib/IconBuilder.php:137:40: TaintedFile: Detected tainted file handling (see https://psalm.dev/255)
$mime = mime_content_type($appIcon);
}

Expand Down Expand Up @@ -181,7 +181,7 @@
* invert app icons for bright primary colors
* the default nextcloud logo will not be inverted to black
*/
if ($this->util->invertTextColor($color)
if ($this->util->isBrightColor($color)
&& !$appIcon instanceof ISimpleFile
&& $app !== "core"
) {
Expand Down Expand Up @@ -232,7 +232,7 @@
if ($imageFile === false || $imageFile === "") {
return false;
}
$svg = file_get_contents($imageFile);

Check failure on line 235 in apps/theming/lib/IconBuilder.php

View workflow job for this annotation

GitHub Actions / static-code-analysis-security

TaintedFile

apps/theming/lib/IconBuilder.php:235:28: TaintedFile: Detected tainted file handling (see https://psalm.dev/255)
if ($svg !== false && $svg !== "") {
$color = $this->util->elementColor($this->themingDefaults->getColorPrimary());
$svg = $this->util->colorizeSvg($svg, $color);
Expand Down
Loading