mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Removing deprecated validator functions on Upload
Use Upload_Validator instead.
This commit is contained in:
parent
9eca2d676f
commit
e52db56ac8
@ -221,88 +221,6 @@ class Upload extends Controller {
|
||||
$this->file = $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get maximum file size for all or specified file extension.
|
||||
*
|
||||
* @deprecated 2.5 Please use Upload_Validator::getAllowedMaxFileSize() instead
|
||||
*
|
||||
* @param string $ext
|
||||
* @return int Filesize in bytes
|
||||
*/
|
||||
public function getAllowedMaxFileSize($ext = null) {
|
||||
Deprecation::notice('2.5', 'Use Upload_Validator::getAllowedMaxFileSize() instead.');
|
||||
return $this->validator->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 Please use Upload_Validator::setAllowedMaxFileSize() instead
|
||||
*
|
||||
* @param array|int $rules
|
||||
*/
|
||||
public function setAllowedMaxFileSize($rules) {
|
||||
Deprecation::notice('2.5', 'Use Upload_Validator::setAllowedMaxFileSize() instead.');
|
||||
$this->validator->setAllowedMaxFileSize($rules);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 2.5 Please use Upload_Validator::getAllowedExtensions() instead
|
||||
* @return array
|
||||
*/
|
||||
public function getAllowedExtensions() {
|
||||
Deprecation::notice('2.5', 'Use Upload_Validator::getAllowedExtensions() instead.');
|
||||
return $this->validator->getAllowedExtensions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 2.5 Please use Upload_Validator::setAllowedExtensions() instead
|
||||
* @param array $rules
|
||||
*/
|
||||
public function setAllowedExtensions($rules) {
|
||||
Deprecation::notice('2.5', 'Use Upload_Validator::setAllowedExtensions() instead.');
|
||||
$this->validator->setAllowedExtensions($rules);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the bytesize of an uploaded
|
||||
* file is valid - can be defined on an
|
||||
* extension-by-extension basis in {$allowedMaxFileSize}
|
||||
*
|
||||
* @deprecated 2.5 Please use Upload_Validator::isValidExtension() instead
|
||||
*
|
||||
* @param array $tmpFile
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValidSize($tmpFile) {
|
||||
Deprecation::notice('2.5', 'Use Upload_Validator::isValidSize() instead.');
|
||||
$validator = new Upload_Validator();
|
||||
$validator->setTmpFile($tmpFile);
|
||||
return $validator->isValidSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the temporary file has a valid extension
|
||||
*
|
||||
* @deprecated 2.5 Please use Upload_Validator::isValidExtension() instead
|
||||
*
|
||||
* @param array $tmpFile
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValidExtension($tmpFile) {
|
||||
Deprecation::notice('2.5', 'Use Upload_Validator::isValidExtension() instead.');
|
||||
$validator = new Upload_Validator();
|
||||
$validator->setTmpFile($tmpFile);
|
||||
return $validator->isValidExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear out all errors (mostly set by {loadUploaded()})
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user