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:
Roman Kelesidis 2024-02-01 18:08:38 +07:00 committed by GitHub
commit 97a9b25bdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -26,6 +26,7 @@
- Some enhancements in default template [\#1312](https://github.com/torrentpier/torrentpier/pull/1312) ([belomaxorka](https://github.com/belomaxorka))
- Some enhancements in default template (Part 2) [\#1322](https://github.com/torrentpier/torrentpier/pull/1322) ([belomaxorka](https://github.com/belomaxorka))
- Set response code in some cases [\#1319](https://github.com/torrentpier/torrentpier/pull/1319) ([belomaxorka](https://github.com/belomaxorka))
- Fixed `admin_terms.php` textarea reset in preview mode [\#1371](https://github.com/torrentpier/torrentpier/pull/1371) ([belomaxorka](https://github.com/belomaxorka))
- Fixed broken user dl status [\#1351](https://github.com/torrentpier/torrentpier/pull/1351) ([belomaxorka](https://github.com/belomaxorka))
- Fixed auth(): empty $f_access [\#1329](https://github.com/torrentpier/torrentpier/pull/1329) ([belomaxorka](https://github.com/belomaxorka))
- Fixed download counter for torrents [\#1346](https://github.com/torrentpier/torrentpier/pull/1346) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -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');