- Increases export filename length and randomness
This commit is contained in:
@ -8,6 +8,7 @@ use MailPoet\Models\Subscriber;
|
|||||||
use MailPoet\Models\SubscriberSegment;
|
use MailPoet\Models\SubscriberSegment;
|
||||||
use MailPoet\Subscribers\ImportExport\ImportExportFactory;
|
use MailPoet\Subscribers\ImportExport\ImportExportFactory;
|
||||||
use MailPoet\Util\Helpers;
|
use MailPoet\Util\Helpers;
|
||||||
|
use MailPoet\Util\Security;
|
||||||
use MailPoet\Util\XLSXWriter;
|
use MailPoet\Util\XLSXWriter;
|
||||||
|
|
||||||
class Export {
|
class Export {
|
||||||
@ -240,7 +241,7 @@ class Export {
|
|||||||
function getExportFile($format) {
|
function getExportFile($format) {
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$this->export_path . '/MailPoet_export_%s.%s',
|
$this->export_path . '/MailPoet_export_%s.%s',
|
||||||
substr(md5(time()), 0, 4),
|
Security::generateRandomString(15),
|
||||||
$format
|
$format
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ class ExportTest extends MailPoetTest {
|
|||||||
expect(
|
expect(
|
||||||
preg_match(
|
preg_match(
|
||||||
'|' .
|
'|' .
|
||||||
Env::$temp_path . '/MailPoet_export_[a-f0-9]{4}.' .
|
Env::$temp_path . '/MailPoet_export_[a-f0-9]{15}.' .
|
||||||
$this->export->export_format_option .
|
$this->export->export_format_option .
|
||||||
'|', $this->export->export_file)
|
'|', $this->export->export_file)
|
||||||
)->equals(1);
|
)->equals(1);
|
||||||
|
Reference in New Issue
Block a user