Skip to content

Commit 770bc40

Browse files
committed
Add date/time variables for export db/files filename since strftime() is deprecated
1 parent 294616f commit 770bc40

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

framework/modules/file/controllers/fileController.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,12 @@ public function export_eql_process() {
991991
// echo gt('You must choose at least one table to export.');
992992
// } else { // All good
993993
$filename = str_replace(
994-
array('__DOMAIN__','__DB__'),
995-
array(str_replace('.','_',HOSTNAME),DB_NAME),
994+
array('__DOMAIN__','__DB__','__DATETIME__','__DATE__','__TIME__'),
995+
array(str_replace('.','_',HOSTNAME),
996+
DB_NAME,date(strftime_to_date_format(DISPLAY_DATETIME_FORMAT), time()),
997+
DB_NAME,date(strftime_to_date_format(DISPLAY_DATE_FORMAT), time()),
998+
DB_NAME,date(strftime_to_date_format(DISPLAY_TIME_FORMAT), time()),
999+
),
9961000
$this->params['filename']);
9971001
if (empty($filename)) {
9981002
$filename = 'database_' . date(strftime_to_date_format(DISPLAY_DATETIME_FORMAT), time());
@@ -1219,8 +1223,12 @@ public function export_files_process() {
12191223
unlink($fname . '.tar'); // remove intermediary .tar file
12201224

12211225
$filename = str_replace(
1222-
array('__DOMAIN__','__DB__'),
1223-
array(str_replace('.','_',HOSTNAME),DB_NAME),
1226+
array('__DOMAIN__','__DB__','__DATETIME__','__DATE__','__TIME__'),
1227+
array(str_replace('.','_',HOSTNAME),
1228+
DB_NAME,date(strftime_to_date_format(DISPLAY_DATETIME_FORMAT), time()),
1229+
DB_NAME,date(strftime_to_date_format(DISPLAY_DATE_FORMAT), time()),
1230+
DB_NAME,date(strftime_to_date_format(DISPLAY_TIME_FORMAT), time()),
1231+
),
12241232
$this->params['filename']);
12251233
if (empty($filename)) {
12261234
$filename = 'files_' . date(strftime_to_date_format(DISPLAY_DATETIME_FORMAT), time());

framework/modules/file/views/file/export_eql.bootstrap4.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
</tr>
104104
<tr>
105105
<td colspan="5">
106-
<div style="border-top: 1px solid #CCC;">{'Use __DOMAIN__ for this website\'s domain name, __DB__ for the site\'s database name and any strftime options for time specification. The EQL extension will be added for you. Any other text will be preserved.'|gettext}<br /></div>
106+
<div style="border-top: 1px solid #CCC;">{'Use __DOMAIN__ for this website\'s domain name, __DB__ for the site\'s database name, and __DATETIME__, __DATE__, or __TIME__. The EQL extension will be added for you. Any other text will be preserved.'|gettext}<br /></div>
107107
</td>
108108
</tr>
109109
<tr>

framework/modules/file/views/file/export_eql.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
</tr>
104104
<tr>
105105
<td colspan="5">
106-
<div style="border-top: 1px solid #CCC;">{'Use __DOMAIN__ for this website\'s domain name, __DB__ for the site\'s database name and any strftime options for time specification. The EQL extension will be added for you. Any other text will be preserved.'|gettext}<br /></div>
106+
<div style="border-top: 1px solid #CCC;">{'Use __DOMAIN__ for this website\'s domain name, __DB__ for the site\'s database name, and __DATETIME__, __DATE__, or __TIME__. The EQL extension will be added for you. Any other text will be preserved.'|gettext}<br /></div>
107107
</td>
108108
</tr>
109109
<tr>

framework/modules/file/views/file/export_files.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</td>
4040
</tr>
4141
<td>
42-
<div style="border-top: 1px solid #CCC;">{'Use __DOMAIN__ for this website\'s domain name and any strftime options for time specification. The extension will be added for you. Any other text will be preserved.'|gettext}<br /></div>
42+
<div style="border-top: 1px solid #CCC;">{'Use __DOMAIN__ for this website\'s domain name, __DB__ for the site\'s database name, and __DATETIME__, __DATE__, or __TIME__. The EQL extension will be added for you. Any other text will be preserved.'|gettext}<br /></div>
4343
</td>
4444
</tr>
4545
<tr>

0 commit comments

Comments
 (0)