mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
0ff72734dd
Previously hard coded size of 1MB meant any file larger was excluded from recipient emails - often confusing for CMS admins configuring an advanced use case for a userform, expecting to recieve files to begin a business process external to the website. The configuration has been made to support PHP 'shorthand byte values' https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes in the configuration option. This give flexibility around oddly specific limits, but can also be used to set as 0, disabling attachments Tests are updated to set up a known state before testing, as to be able to accurately assert the results. One should test the class they intend, not an Injector service of some unknown element.
15 lines
378 B
PHP
15 lines
378 B
PHP
<?php
|
|
|
|
namespace SilverStripe\UserForms\Tests\Control\fixtures;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\UserForms\Control\UserDefinedFormController;
|
|
|
|
class SizeStringTestableController extends UserDefinedFormController implements TestOnly
|
|
{
|
|
public function convertSizeStringToBytes($sizeString)
|
|
{
|
|
return $this->parseByteSizeString($sizeString);
|
|
}
|
|
}
|