Merge pull request #757 from sanmadjack/pull
Adjusted mime type update statement to include NULLs. Changed get_mim…
This commit is contained in:
commit
3c10d1cfee
2 changed files with 2 additions and 2 deletions
|
@ -598,7 +598,7 @@ class Image
|
||||||
/**
|
/**
|
||||||
* Get the image's mime type.
|
* Get the image's mime type.
|
||||||
*/
|
*/
|
||||||
public function get_mime(): string
|
public function get_mime(): ?string
|
||||||
{
|
{
|
||||||
if ($this->mime===MimeType::WEBP&&$this->lossless) {
|
if ($this->mime===MimeType::WEBP&&$this->lossless) {
|
||||||
return MimeType::WEBP_LOSSLESS;
|
return MimeType::WEBP_LOSSLESS;
|
||||||
|
|
|
@ -45,7 +45,7 @@ class MimeSystem extends Extension
|
||||||
$normalized_extension = FileExtension::get_for_mime($mime);
|
$normalized_extension = FileExtension::get_for_mime($mime);
|
||||||
|
|
||||||
$database->execute(
|
$database->execute(
|
||||||
"UPDATE images SET mime = :mime, ext = :new_ext WHERE ext = :ext AND (mime != :mime OR ext != :new_ext)",
|
"UPDATE images SET mime = :mime, ext = :new_ext WHERE ext = :ext AND (mime IS NULL OR mime != :mime OR ext != :new_ext)",
|
||||||
["mime" => $mime, "new_ext" => $normalized_extension, "ext" => $ext]
|
["mime" => $mime, "new_ext" => $normalized_extension, "ext" => $ext]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue