6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
9/19/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#2507] MIME, analyzeFile limited regexp fails to recognize valid mime-types
*
Your Email Address
*
Spam protection
Enter the letters below:
. .. .__..___. . | || | |[__ | | |/\||___|__|[___|/\|
Comment
> In MIME package and in analyzeFile() function there is this snippet of code: > > ... > > if (preg_match('|^[a-z0-9]+/[a-z0-9]+$|', $type)) { > > return $type; > > } > > ... > > > > This regexp to check mime-type seems very limited and does not seem > to match to a valid mime-type like application/octet-stream. > > > > I would suggest something like this: > > if(preg_match('|^[a-z0-9]+/[a-z0-9]+(?:[.-][a-z0-9]+)*$|i', $type)) { > > ... > > }
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers