Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Adds SVG images as non-binary

Author Dave Jarvis <email>
Date 2026-02-18 17:26:58 GMT-0800
Commit 69cf0337a6a84b522eeefe402c29634fb1fdacd5
Parent a224cd2
File.php
private const MEDIA_PDF = 'application/pdf';
private const MEDIA_TEXT_PRE = 'text/';
+ private const MEDIA_SVG = 'image/svg';
private const ARCHIVE_EXT = [
private function detectBinary(): bool {
return $this->mediaType !== self::MEDIA_EMPTY &&
- !str_starts_with( $this->mediaType, self::MEDIA_TEXT_PRE );
+ !str_starts_with( $this->mediaType, self::MEDIA_TEXT_PRE ) &&
+ !str_contains( $this->mediaType, self::MEDIA_SVG );
}
Delta 3 lines added, 1 line removed, 2-line increase