mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE Remove deprecated methods getAllowedMaxFileSize, setAllowedMaxSize, getAllowedExtensions and setAllowedExtensions on FileField
This commit is contained in:
parent
09db4ba695
commit
454023c666
@ -178,56 +178,6 @@ class FileField extends FormField {
|
||||
$this->upload->setValidator($validator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get maximum file size for all or specified file extension.
|
||||
* Falls back to the default filesize restriction ('*')
|
||||
* if the extension was not found.
|
||||
*
|
||||
* @deprecated 2.5
|
||||
* @param string $ext
|
||||
* @return int Filesize in bytes (0 means no filesize set)
|
||||
*/
|
||||
public function getAllowedMaxFileSize($ext = null) {
|
||||
user_error('Upload::getAllowedMaxFileSize() is deprecated. Please use Upload_Validator::getAllowedMaxFileSize() instead', E_USER_NOTICE);
|
||||
$this->getValidator()->getAllowedMaxFileSize($ext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set filesize maximums (in bytes).
|
||||
* Automatically converts extensions to lowercase
|
||||
* for easier matching.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* array('*' => 200, 'jpg' => 1000)
|
||||
* </code>
|
||||
*
|
||||
* @deprecated 2.5
|
||||
* @param unknown_type $rules
|
||||
*/
|
||||
public function setAllowedMaxFileSize($rules) {
|
||||
user_error('Upload::setAllowedMaxFileSize() is deprecated. Please use Upload_Validator::setAllowedMaxFileSize() instead', E_USER_NOTICE);
|
||||
$this->getValidator()->setAllowedMaxFileSize($rules);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 2.5
|
||||
* @return array
|
||||
*/
|
||||
public function getAllowedExtensions() {
|
||||
user_error('Upload::getAllowedExtensions() is deprecated. Please use Upload_Validator::getAllowedExtensions() instead', E_USER_NOTICE);
|
||||
return $this->getValidator()->getAllowedExtensions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 2.5
|
||||
* @param array $rules
|
||||
*/
|
||||
public function setAllowedExtensions($rules) {
|
||||
user_error('Upload::setAllowedExtensions() is deprecated. Please use Upload_Validator::setAllowedExtensions() instead', E_USER_NOTICE);
|
||||
$this->getValidator()->setAllowedExtensions($rules);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $folderName
|
||||
*/
|
||||
@ -258,5 +208,4 @@ class FileField extends FormField {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
Loading…
Reference in New Issue
Block a user