Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/config/PhabricatorFilesConfigOptions.php
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | $icon_default = array( | ||||
'application/msword' => 'fa-file-word-o', | 'application/msword' => 'fa-file-word-o', | ||||
// msexcel | // msexcel | ||||
'application/vnd.ms-excel' => 'fa-file-excel-o', | 'application/vnd.ms-excel' => 'fa-file-excel-o', | ||||
// mspowerpoint | // mspowerpoint | ||||
'application/vnd.ms-powerpoint' => 'fa-file-powerpoint-o', | 'application/vnd.ms-powerpoint' => 'fa-file-powerpoint-o', | ||||
) + array_fill_keys(array_keys($image_default), 'fa-file-image-o'); | ) + array_fill_keys(array_keys($image_default), 'fa-file-image-o'); | ||||
// NOTE: These options are locked primarily because adding "text/plain" | |||||
// as an image MIME type increases SSRF vulnerability by allowing users | |||||
// to load text files from remote servers as "images" (see T6755 for | |||||
// discussion). | |||||
return array( | return array( | ||||
$this->newOption('files.viewable-mime-types', 'wild', $viewable_default) | $this->newOption('files.viewable-mime-types', 'wild', $viewable_default) | ||||
->setLocked(true) | |||||
->setSummary( | ->setSummary( | ||||
pht('Configure which MIME types are viewable in the browser.')) | pht('Configure which MIME types are viewable in the browser.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Configure which uploaded file types may be viewed directly '. | 'Configure which uploaded file types may be viewed directly '. | ||||
'in the browser. Other file types will be downloaded instead '. | 'in the browser. Other file types will be downloaded instead '. | ||||
'of displayed. This is mainly a usability consideration, since '. | 'of displayed. This is mainly a usability consideration, since '. | ||||
'browsers tend to freak out when viewing enormous binary files.'. | 'browsers tend to freak out when viewing enormous binary files.'. | ||||
"\n\n". | "\n\n". | ||||
'The keys in this map are vieweable MIME types; the values are '. | 'The keys in this map are vieweable MIME types; the values are '. | ||||
'the MIME types they are delivered as when they are viewed in '. | 'the MIME types they are delivered as when they are viewed in '. | ||||
'the browser.')), | 'the browser.')), | ||||
$this->newOption('files.image-mime-types', 'set', $image_default) | $this->newOption('files.image-mime-types', 'set', $image_default) | ||||
->setLocked(true) | |||||
->setSummary(pht('Configure which MIME types are images.')) | ->setSummary(pht('Configure which MIME types are images.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'List of MIME types which can be used as the `src` for an '. | 'List of MIME types which can be used as the `src` for an '. | ||||
'`<img />` tag.')), | '`<img />` tag.')), | ||||
$this->newOption('files.audio-mime-types', 'set', $audio_default) | $this->newOption('files.audio-mime-types', 'set', $audio_default) | ||||
->setLocked(true) | |||||
->setSummary(pht('Configure which MIME types are audio.')) | ->setSummary(pht('Configure which MIME types are audio.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'List of MIME types which can be used to render an '. | 'List of MIME types which can be used to render an '. | ||||
'`<audio />` tag.')), | '`<audio />` tag.')), | ||||
$this->newOption('files.icon-mime-types', 'wild', $icon_default) | $this->newOption('files.icon-mime-types', 'wild', $icon_default) | ||||
->setLocked(true) | |||||
->setSummary(pht('Configure which MIME types map to which icons.')) | ->setSummary(pht('Configure which MIME types map to which icons.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Map of MIME type to icon name. MIME types which can not be '. | 'Map of MIME type to icon name. MIME types which can not be '. | ||||
'found default to icon `doc_files`.')), | 'found default to icon `doc_files`.')), | ||||
$this->newOption('storage.mysql-engine.max-size', 'int', 1000000) | $this->newOption('storage.mysql-engine.max-size', 'int', 1000000) | ||||
->setSummary( | ->setSummary( | ||||
pht( | pht( | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |