protected function YamlFormManagedFileBase::getUriScheme in YAML Form 8
Get file upload URI scheme.
Defaults to private file uploads.
Drupal file upload by anonymous or untrusted users into public file systems -- PSA-2016-003.
Parameters
array $element: An element.
Return value
string File upload URI scheme.
See also
https://www.drupal.org/psa-2016-003
3 calls to YamlFormManagedFileBase::getUriScheme()
- YamlFormManagedFileBase::displayDisabledWarning in src/
Plugin/ YamlFormElement/ YamlFormManagedFileBase.php - Display element disabled warning.
- YamlFormManagedFileBase::getUploadLocation in src/
Plugin/ YamlFormElement/ YamlFormManagedFileBase.php - Get file upload location.
- YamlFormManagedFileBase::prepare in src/
Plugin/ YamlFormElement/ YamlFormManagedFileBase.php - Prepare an element to be rendered within a form.
File
- src/
Plugin/ YamlFormElement/ YamlFormManagedFileBase.php, line 493
Class
- YamlFormManagedFileBase
- Provides a base class form 'managed_file' elements.
Namespace
Drupal\yamlform\Plugin\YamlFormElementCode
protected function getUriScheme(array $element) {
if (isset($element['#uri_scheme'])) {
return $element['#uri_scheme'];
}
$scheme_options = self::getVisibleStreamWrappers();
if (isset($scheme_options['private'])) {
return 'private';
}
elseif (isset($scheme_options['public'])) {
return 'public';
}
else {
return 'private';
}
}