Skip to content

Commit

Permalink
Maked max smilies in PM configurable (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
belomaxorka committed Jul 11, 2023
1 parent 96828ca commit 728c074
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

- Release v2.1.5-2023.07 🎉
- Fix RFC 1918 RegExp [\#210](https://github.com/torrentpier/torrentpier-lts/pull/210) ([belomaxorka](https://github.com/belomaxorka))
- Maked max smilies in PM configurable [\#211](https://github.com/torrentpier/torrentpier-lts/pull/211) ([belomaxorka](https://github.com/belomaxorka))

## [v2.1.5-2023.06](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.06) (2023-07-04)
[Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.05...v2.1.5-2023.06)
Expand Down
11 changes: 11 additions & 0 deletions privmsg.php
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,17 @@
$error = TRUE;
$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['EMPTY_MESSAGE'];
}

// Check smilies limit
if ($bb_cfg['max_smilies_pm'])
{
$count_smilies = substr_count(bbcode2html($privmsg_message), '<img class="smile" src="'. $bb_cfg['smilies_path']);
if ($count_smilies > $bb_cfg['max_smilies_pm'])
{
$error = TRUE;
$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies_pm']);
}
}
}

if ( $submit && !$error )
Expand Down

0 comments on commit 728c074

Please sign in to comment.