mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Fixed admin_terms.php
textarea reset in preview mode (#1371)
* Fixed `admin_terns.php` textarea reset in preview mode * Update CHANGELOG.md
This commit is contained in:
parent
dd70686fa2
commit
97a9b25bdd
2 changed files with 6 additions and 3 deletions
|
@ -15,7 +15,9 @@ if (!empty($setmodules)) {
|
|||
require __DIR__ . '/pagestart.php';
|
||||
require INC_DIR . '/bbcode.php';
|
||||
|
||||
if (isset($_POST['post']) && $bb_cfg['terms'] != $_POST['message']) {
|
||||
$preview = isset($_POST['preview']);
|
||||
|
||||
if (isset($_POST['post']) && ($bb_cfg['terms'] !== $_POST['message'])) {
|
||||
bb_update_config(['terms' => $_POST['message']]);
|
||||
bb_die($lang['CONFIG_UPDATED']);
|
||||
}
|
||||
|
@ -23,8 +25,8 @@ if (isset($_POST['post']) && $bb_cfg['terms'] != $_POST['message']) {
|
|||
$template->assign_vars([
|
||||
'S_ACTION' => 'admin_terms.php',
|
||||
'EXT_LINK_NW' => $bb_cfg['ext_link_new_win'],
|
||||
'MESSAGE' => $bb_cfg['terms'] ?: '',
|
||||
'PREVIEW_HTML' => isset($_REQUEST['preview']) ? bbcode2html($_POST['message']) : '',
|
||||
'MESSAGE' => $preview ? $_POST['message'] : $bb_cfg['terms'],
|
||||
'PREVIEW_HTML' => $preview ? bbcode2html($_POST['message']) : '',
|
||||
]);
|
||||
|
||||
print_page('admin_terms.tpl', 'admin');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue