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

[stable29] fix(mail): Fix big logos in mail templates for Outlook #46627

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Jul 19, 2024

Backport of PR #46419

Signed-off-by: Joas Schilling <coding@schilljs.com>
@@ -209,6 +209,10 @@
} catch (NotFoundException $e) {
} catch (NotPermittedException $e) {
}

if ($key === 'logo') {
$this->config->deleteAppValue('theming', 'logoDimensions');

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::deleteAppValue has been marked as deprecated
$content = file_get_contents($tmpFile);
$newImage = @imagecreatefromstring($content);
if ($newImage !== false) {
$this->config->setAppValue('theming', 'logoDimensions', imagesx($newImage) . 'x' . imagesy($newImage));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::setAppValue has been marked as deprecated
} elseif (str_starts_with($detectedMimeType, 'image/svg')) {
$matched = preg_match('/viewbox=["\']\d* \d* (\d*\.?\d*) (\d*\.?\d*)["\']/i', $content, $matches);
if ($matched) {
$this->config->setAppValue('theming', 'logoDimensions', $matches[1] . 'x' . $matches[2]);

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::setAppValue has been marked as deprecated
$this->config->setAppValue('theming', 'logoDimensions', $matches[1] . 'x' . $matches[2]);
} else {
$this->logger->warning('Could not read logo image dimensions to optimize for mail header');
$this->config->deleteAppValue('theming', 'logoDimensions');

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::deleteAppValue has been marked as deprecated
}
} else {
$this->logger->warning('Could not read logo image dimensions to optimize for mail header');
$this->config->deleteAppValue('theming', 'logoDimensions');

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::deleteAppValue has been marked as deprecated
$content = file_get_contents($tmpFile);
$newImage = @imagecreatefromstring($content);
if ($newImage !== false) {
$this->config->setAppValue('theming', 'logoDimensions', imagesx($newImage) . 'x' . imagesy($newImage));

Check notice

Code scanning / Psalm

PossiblyFalseOperand Note

Cannot concatenate with a possibly false false|int
$content = file_get_contents($tmpFile);
$newImage = @imagecreatefromstring($content);
if ($newImage !== false) {
$this->config->setAppValue('theming', 'logoDimensions', imagesx($newImage) . 'x' . imagesy($newImage));

Check notice

Code scanning / Psalm

PossiblyFalseOperand Note

Cannot concatenate with a possibly false false|int
@nickvergessen nickvergessen merged commit 8bbf4ec into stable29 Jul 19, 2024
177 checks passed
@nickvergessen nickvergessen deleted the backport/46419/stable29 branch July 19, 2024 09:03
@Altahrim Altahrim mentioned this pull request Aug 8, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants