Skip to content

Commit

Permalink
Fix notification when image has a missing width/height; fixes #8795
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne authored and trasher committed Mar 10, 2021
1 parent f2f6a77 commit 647ad1b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions inc/document.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1520,15 +1520,15 @@ public static function isImage($file) {
* @return string Image path on disk
*/
public static function getImage($path, $context, $mwidth = null, $mheight = null) {
if ($mwidth === null && $mheight === null) {
if ($mwidth === null || $mheight === null) {
switch ($context) {
case 'mail':
$mwidth = 400;
$mheight = 300;
$mwidth = $mwidth ?? 400;
$mheight = $mheight ?? 300;
break;
case 'timeline':
$mwidth = 100;
$mheight = 100;
$mwidth = $mwidth ?? 100;
$mheight = $mheight ?? 100;
break;
default:
throw new \RuntimeException("Unknown context $context!");
Expand Down

0 comments on commit 647ad1b

Please sign in to comment.