Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/PhabricatorDocumentRef.php
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | if ($this->file) { | ||||
return $result; | return $result; | ||||
} | } | ||||
throw new PhutilMethodNotImplementedException(); | throw new PhutilMethodNotImplementedException(); | ||||
} | } | ||||
public function hasAnyMimeType(array $candidate_types) { | public function hasAnyMimeType(array $candidate_types) { | ||||
$mime_full = $this->getMimeType(); | $mime_full = $this->getMimeType(); | ||||
if (!phutil_nonempty_string($mime_full)) { | |||||
return false; | |||||
} | |||||
$mime_parts = explode(';', $mime_full); | $mime_parts = explode(';', $mime_full); | ||||
$mime_type = head($mime_parts); | $mime_type = head($mime_parts); | ||||
$mime_type = $this->normalizeMimeType($mime_type); | $mime_type = $this->normalizeMimeType($mime_type); | ||||
foreach ($candidate_types as $candidate_type) { | foreach ($candidate_types as $candidate_type) { | ||||
if ($this->normalizeMimeType($candidate_type) === $mime_type) { | if ($this->normalizeMimeType($candidate_type) === $mime_type) { | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |