Changeset 1534

Show
Ignore:
Timestamp:
02/28/08 18:58:58 (2 months ago)
Author:
Anatoly
Message:

New constant PUN_MAX_POSTSIZE = 65535 is defined in common.php. Used in post/edit forms and parser.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/punbb-1.3-dev/upload/edit.php

    r1533 r1534  
    109109        if ($message == '') 
    110110                $errors[] = $lang_post['No message']; 
    111         else if (strlen($message) > 65535
     111        else if (strlen($message) > PUN_MAX_POSTSIZE
    112112                $errors[] = $lang_post['Too long message']; 
    113113        else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && !$pun_user['is_admmod']) 
  • branches/punbb-1.3-dev/upload/include/common.php

    r1533 r1534  
    5555define('PUN_GUEST', 2); 
    5656define('PUN_MEMBER', 3); 
     57define('PUN_MAX_POSTSIZE', 65535); 
    5758 
    5859 
  • branches/punbb-1.3-dev/upload/include/parser.php

    r1533 r1534  
    128128                        $q2_start = strpos($text, $matches[0]); 
    129129                else 
    130                         $q2_start = 65536
     130                        $q2_start = PUN_MAX_POSTSIZE + 1
    131131 
    132132                // Deal with strpos() returning false when the string is not found 
    133                 // (65536 is one byte longer than the maximum post length) 
    134                 if ($c_start === false) $c_start = 65536
    135                 if ($c_end === false) $c_end = 65536
    136                 if ($q_start === false) $q_start = 65536
    137                 if ($q_end === false) $q_end = 65536
     133                // (PUN_MAX_POSTSIZE + 1 is one byte longer than the maximum post length) 
     134                if ($c_start === false) $c_start = PUN_MAX_POSTSIZE + 1
     135                if ($c_end === false) $c_end = PUN_MAX_POSTSIZE + 1
     136                if ($q_start === false) $q_start = PUN_MAX_POSTSIZE + 1
     137                if ($q_end === false) $q_end = PUN_MAX_POSTSIZE + 1
    138138 
    139139                // If none of the strings were found 
    140                 if (min($c_start, $c_end, $q_start, $q_end, $q2_start) == 65536
     140                if (min($c_start, $c_end, $q_start, $q_end, $q2_start) == PUN_MAX_POSTSIZE + 1
    141141                        break; 
    142142 
  • branches/punbb-1.3-dev/upload/lang/English/misc.php

    r1490 r1534  
    1212'No e-mail subject'                     =>      'You must enter a subject.', 
    1313'No e-mail message'                     =>      'You must enter a message.', 
    14 'Too long e-mail message'       =>      'Messages cannot be longer than 65535 characters (64 KB).', 
     14'Too long e-mail message'       =>      'Messages cannot be longer than '.PUN_MAX_POSTSIZE.' characters.', 
    1515'E-mail sent redirect'          =>      'E-mail sent. Redirecting 
', 
    1616'E-mail subject'                        =>      'Subject:', 
  • branches/punbb-1.3-dev/upload/lang/English/post.php

    r1485 r1534  
    88'Too long subject'              =>      'Subjects cannot be longer than 70 characters.', 
    99'No message'                    =>      'You must enter a message.', 
    10 'Too long message'              =>      'Posts cannot be longer that 65535 characters (64 KB).', 
     10'Too long message'              =>      'Posts cannot be longer than '.PUN_MAX_POSTSIZE.' characters.', 
    1111'CSRF token mismatch'   =>      'Unable to confirm security token. A likely cause for this is that some time passed between when you first entered the page and when you posted the form. Clicking "Submit" again should solve the problem.', 
    1212 
  • branches/punbb-1.3-dev/upload/misc.php

    r1533 r1534  
    164164                if ($message == '') 
    165165                        $errors[] = $lang_misc['No e-mail message']; 
    166                 else if (strlen($message) > 65535
     166                else if (strlen($message) > PUN_MAX_POSTSIZE
    167167                        $errors[] = $lang_misc['Too long e-mail message']; 
    168168 
  • branches/punbb-1.3-dev/upload/post.php

    r1533 r1534  
    171171        if ($message == '') 
    172172                $errors[] = $lang_post['No message']; 
    173         else if (strlen($message) > 65535
     173        else if (strlen($message) > PUN_MAX_POSTSIZE
    174174                $errors[] = $lang_post['Too long message']; 
    175175        else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && !$pun_user['is_admmod'])