Skip to content

Commit 748eb8e

Browse files
author
Sam Tuke
authored
Merge pull request #493 from phpList/phplist4-restapi
Save secret in db for phpList4
2 parents 54698f1 + eb8ccf4 commit 748eb8e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

public_html/lists/admin/initialise.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ function output($message)
191191
SaveConfig('message_from_address', $adminemail);
192192
SaveConfig('message_from_name', strip_tags($_REQUEST['adminname']));
193193
SaveConfig('message_replyto_address', $adminemail);
194+
SaveConfig('secret', bin2hex(random_bytes(20)));
194195
SaveConfig('lastcheckupdate', date('m/d/Y h:i:s', time()), 0, true);
195196

196197
if (!empty($_REQUEST['orgname'])) {
@@ -248,4 +249,4 @@ function output($message)
248249
s('Upgrade')).' '.s('instead?').'</li>
249250
<li>' .PageLinkButton('initialise', s('Force Initialisation'),
250251
'force=yes').' '.s('(will erase all data!)').' '."</li></ul></div>\n";
251-
}
252+
}

public_html/lists/admin/upgrade.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,16 @@ function output($message)
369369
if (version_compare($dbversion, '3.3.3','<')) {
370370
// add a draft campaign for invite plugin
371371
addInviteCampaign();
372-
373372
}
374373

375374
if (version_compare($dbversion, '3.3.4','<')) {
376375
Sql_Query("alter table {$GLOBALS['tables']['bounce']} modify data mediumblob ");
377376
}
378377

378+
if (version_compare($dbversion, '3.4.0-RC1','<')) {
379+
SaveConfig('secret', bin2hex(random_bytes(20)));
380+
}
381+
379382
//# longblobs are better at mixing character encoding. We don't know the encoding of anything we may want to store in cache
380383
//# before converting, it's quickest to clear the cache
381384
clearPageCache();

0 commit comments

Comments
 (0)