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
					
				| @ -598,7 +598,7 @@ class Image | ||||
|     /** | ||||
|      * Get the image's mime type. | ||||
|      */ | ||||
|     public function get_mime(): string | ||||
|     public function get_mime(): ?string | ||||
|     { | ||||
|         if ($this->mime===MimeType::WEBP&&$this->lossless) { | ||||
|             return MimeType::WEBP_LOSSLESS; | ||||
|  | ||||
| @ -45,7 +45,7 @@ class MimeSystem extends Extension | ||||
|                 $normalized_extension = FileExtension::get_for_mime($mime); | ||||
| 
 | ||||
|                 $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] | ||||
|                 ); | ||||
|             } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user