Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9525

Minimum characters per post/message should never be '0'

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.7-PL1
    • Fix Version/s: 3.0.10-RC1
    • Component/s: ACP, Posting
    • Labels:
      None
    • Environment:
      PHP Version 5.2.7
      MySQL 5.1.3
      Firefox v3.6.3
      Win7

      Description

      ACP> General> Post Settings> Minimum characters per post/message:

      When this option is set to zero in the ACP it is still necessary to have at least one character to post otherwise you get the error:

      "Your message contains too few characters."

      Either you should be allowed to submit an empty PM or the option to set it to zero should not be available.

      Similar to: http://tracker.phpbb.com/browse/PHPBB3-8442?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel

        Activity

        Hide
        mixstar mixstar added a comment -

        I didn't check before but this is the same for posting.

        Show
        mixstar mixstar added a comment - I didn't check before but this is the same for posting.
        Hide
        A_Jelly_Doughnut A_Jelly_Doughnut added a comment -

        Its very clear from the code that this is the intended behavior (there's too much code for it to be a mistake):

        			if (!$message_length || $message_length < (int) $config['min_post_chars'])
        			{
        				$this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_FEW_CHARS_LIMIT'], $message_length, (int) $config['min_post_chars']);
        				return (!$update_this_message) ? $return_message : $this->warn_msg;
        			}

        (message_parser.php)

        However, it is not immediately clear why this was done.

        Show
        A_Jelly_Doughnut A_Jelly_Doughnut added a comment - Its very clear from the code that this is the intended behavior (there's too much code for it to be a mistake): if (!$message_length || $message_length < (int) $config['min_post_chars']) { $this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_FEW_CHARS_LIMIT'], $message_length, (int) $config['min_post_chars']); return (!$update_this_message) ? $return_message : $this->warn_msg; } (message_parser.php) However, it is not immediately clear why this was done.
        Hide
        bantu Andreas Fischer added a comment -

        It may have been copy-pasted from the max_post_chars section. - Just a guess.

        Show
        bantu Andreas Fischer added a comment - It may have been copy-pasted from the max_post_chars section. - Just a guess.
        Hide
        narqelion narqelion [X] (Inactive) added a comment -

        Zero characters in a post was never allowed, even before the ACP config value of Minimum characters per post/message: was added (for the QR feature) in 3.0.6. Since the default value was populated with '1' I can only surmise '0' is still not supposed to be supported but that a min/max validation check is not set on the ACP field.

        Mixstar wrote: ...the option to set it to zero should not be available

        That is what I would expect, which is consistent with other existing config variables in the ACP.

        Show
        narqelion narqelion [X] (Inactive) added a comment - Zero characters in a post was never allowed, even before the ACP config value of Minimum characters per post/message: was added (for the QR feature) in 3.0.6. Since the default value was populated with '1' I can only surmise '0' is still not supposed to be supported but that a min/max validation check is not set on the ACP field. Mixstar wrote: ...the option to set it to zero should not be available That is what I would expect, which is consistent with other existing config variables in the ACP.
        Hide
        Tony Stark Tony Stark [X] (Inactive) added a comment -

        if they decide 0 isn't a valid option, they should at least stop you from being able to set the minimum value as 0 and still get a green config updated successfully box.

        Show
        Tony Stark Tony Stark [X] (Inactive) added a comment - if they decide 0 isn't a valid option, they should at least stop you from being able to set the minimum value as 0 and still get a green config updated successfully box.
        Hide
        Peetra Peetra added a comment -

        This is a question 'bout semantics. Just change the lang file /en/acp/board.php, line 177
        from

        	'MIN_CHAR_LIMIT_EXPLAIN'		=> 'The minimum number of characters the user need to enter within a post/private message.',

        to

        	'MIN_CHAR_LIMIT_EXPLAIN'		=> 'The minimum number of characters the user need to enter within a post/private message. The board won't notice 0 as a serious option and will secretly laugh at your try.',

        So! Problem solved!

        Show
        Peetra Peetra added a comment - This is a question 'bout semantics. Just change the lang file /en/acp/board.php, line 177 from 'MIN_CHAR_LIMIT_EXPLAIN' => 'The minimum number of characters the user need to enter within a post/private message.', to 'MIN_CHAR_LIMIT_EXPLAIN' => 'The minimum number of characters the user need to enter within a post/private message. The board won't notice 0 as a serious option and will secretly laugh at your try.', So! Problem solved!

          People

          • Assignee:
            Unassigned
            Reporter:
            mixstar mixstar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development