Skip to content
Browse files

Fixed hardcoded max_subject_length

  • Loading branch information...
1 parent a7228f0 commit b2ea2efe3ca6fd720d00c0e23916f8acb54c96ea @ashcs ashcs committed Jun 11, 2012
Showing with 10 additions and 10 deletions.
  1. +2 −2 edit.php
  2. +1 −1 lang/English/misc.php
  3. +1 −1 lang/English/post.php
  4. +2 −2 misc.php
  5. +2 −2 moderate.php
  6. +2 −2 post.php
View
4 edit.php
@@ -90,7 +90,7 @@
if ($subject == '')
$errors[] = $lang_post['No subject'];
else if (utf8_strlen($subject) > FORUM_SUBJECT_MAXIMUM_LENGTH)
- $errors[] = $lang_post['Too long subject'];
+ $errors[] = sprintf($lang_post['Too long subject'], FORUM_SUBJECT_MAXIMUM_LENGTH);
else if ($forum_config['p_subject_all_caps'] == '0' && check_is_all_caps($subject) && !$forum_page['is_admmod'])
$subject = utf8_ucwords(utf8_strtolower($subject));
}
@@ -297,7 +297,7 @@
<?php if ($can_edit_subject): ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
<div class="sf-box text required">
<label for="fld<?php echo ++ $forum_page['fld_count'] ?>"><span><?php echo $lang_post['Topic subject'] ?></span></label><br />
- <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="req_subject" size="70" maxlength="70" value="<?php echo forum_htmlencode(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" required /></span>
+ <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="req_subject" size="<?php echo FORUM_SUBJECT_MAXIMUM_LENGTH ?>" maxlength="<?php echo FORUM_SUBJECT_MAXIMUM_LENGTH ?>" value="<?php echo forum_htmlencode(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" required /></span>
</div>
</div>
<?php endif; ($hook = get_hook('ed_pre_message_box')) ? eval($hook) : null; ?> <div class="txt-set set<?php echo ++$forum_page['item_count'] ?>">
View
2 lang/English/misc.php
@@ -11,7 +11,7 @@
'Form e-mail errors' => '<strong>Warning!</strong> The following errors must be corrected before your message can be sent:',
'No e-mail subject' => 'You must enter a subject.',
'No e-mail message' => 'You must enter a message.',
-'Too long e-mail subject' => 'Subjects cannot be longer than 70 characters.',
+'Too long e-mail subject' => 'Subjects cannot be longer than %s characters.',
'Too long e-mail message' => 'Your message length is %s bytes. This exceeds the %s bytes limit.',
'Email flood' => 'At least %s seconds have to pass between sent emails. Please wait a while and try sending again.',
'E-mail sent redirect' => 'Email sent.',
View
2 lang/English/post.php
@@ -5,7 +5,7 @@
// Post validation stuff (many are similar to those in edit.php)
'No subject' => 'Topics must contain a subject.',
-'Too long subject' => 'Subjects cannot be longer than 70 characters.',
+'Too long subject' => 'Subjects cannot be longer than %s characters.',
'All caps subject' => 'Subjects cannot contain only capital letters.',
'No message' => 'You must enter a message.',
'Too long message' => 'Your post length is %s bytes. This exceeds the %s bytes limit.',
View
4 misc.php
@@ -234,7 +234,7 @@
if ($subject == '')
$errors[] = $lang_misc['No e-mail subject'];
else if (utf8_strlen($subject) > FORUM_SUBJECT_MAXIMUM_LENGTH)
- $errors[] = $lang_misc['Too long e-mail subject'];
+ $errors[] = sprintf($lang_misc['Too long e-mail subject'], FORUM_SUBJECT_MAXIMUM_LENGTH);
if ($message == '')
$errors[] = $lang_misc['No e-mail message'];
@@ -363,7 +363,7 @@
<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
<div class="sf-box text required longtext">
<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_misc['E-mail subject'] ?></span></label><br />
- <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_subject" value="<?php echo(isset($_POST['req_subject']) ? forum_htmlencode($_POST['req_subject']) : '') ?>" size="75" maxlength="70" required /></span>
+ <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_subject" value="<?php echo(isset($_POST['req_subject']) ? forum_htmlencode($_POST['req_subject']) : '') ?>" size="<?php echo FORUM_SUBJECT_MAXIMUM_LENGTH ?>" maxlength="<?php echo FORUM_SUBJECT_MAXIMUM_LENGTH ?>" required /></span>
</div>
</div>
<?php ($hook = get_hook('mi_email_pre_message_contents')) ? eval($hook) : null; ?>
View
4 moderate.php
@@ -292,7 +292,7 @@
if ($new_subject == '')
message($lang_post['No subject']);
else if (utf8_strlen($new_subject) > FORUM_SUBJECT_MAXIMUM_LENGTH)
- message($lang_post['Too long subject']);
+ message(sprintf($lang_post['Too long subject'], FORUM_SUBJECT_MAXIMUM_LENGTH));
// Get data from the new first post
$query = array(
@@ -381,7 +381,7 @@
<?php ($hook = get_hook('mr_confirm_split_posts_pre_subject')) ? eval($hook) : null; ?>
<div class="sf-box text required">
<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_misc['New subject'] ?></span></label><br />
- <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="new_subject" size="70" maxlength="70" required /></span>
+ <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="new_subject" size="<?php echo FORUM_SUBJECT_MAXIMUM_LENGTH ?>" maxlength="<?php echo FORUM_SUBJECT_MAXIMUM_LENGTH ?>" required /></span>
</div>
<?php ($hook = get_hook('mr_confirm_split_posts_pre_confirm_checkbox')) ? eval($hook) : null; ?>
<div class="sf-box checkbox">
View
4 post.php
@@ -122,7 +122,7 @@
if ($subject == '')
$errors[] = $lang_post['No subject'];
else if (utf8_strlen($subject) > FORUM_SUBJECT_MAXIMUM_LENGTH)
- $errors[] = $lang_post['Too long subject'];
+ $errors[] = sprintf($lang_post['Too long subject'], FORUM_SUBJECT_MAXIMUM_LENGTH);
else if ($forum_config['p_subject_all_caps'] == '0' && check_is_all_caps($subject) && !$forum_page['is_admmod'])
$errors[] = $lang_post['All caps subject'];
}
@@ -469,7 +469,7 @@
<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
<div class="sf-box text required longtext">
<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_post['Topic subject'] ?></span></label><br />
- <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo forum_htmlencode($subject); ?>" size="70" maxlength="70" required /></span>
+ <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo forum_htmlencode($subject); ?>" size="<?php echo FORUM_SUBJECT_MAXIMUM_LENGTH ?>" maxlength="<?php echo FORUM_SUBJECT_MAXIMUM_LENGTH ?>" required /></span>
</div>
</div>
<?php

0 comments on commit b2ea2ef

Please sign in to comment.
Something went wrong with that request. Please try again.