| @@ 69-70 (lines=2) @@ | ||
| 66 | ||
| 67 | // message and subject still need a bit more work |
|
| 68 | preparsecode($draft['body']); |
|
| 69 | if ($smcFunc['strlen']($draft['subject']) > 100) |
|
| 70 | $draft['subject'] = $smcFunc['substr']($draft['subject'], 0, 100); |
|
| 71 | ||
| 72 | // Modifying an existing draft, like hitting the save draft button or autosave enabled? |
|
| 73 | if (!empty($id_draft) && !empty($draft_info)) |
|
| @@ 218-219 (lines=2) @@ | ||
| 215 | ||
| 216 | // message and subject always need a bit more work |
|
| 217 | preparsecode($draft['body']); |
|
| 218 | if ($smcFunc['strlen']($draft['subject']) > 100) |
|
| 219 | $draft['subject'] = $smcFunc['substr']($draft['subject'], 0, 100); |
|
| 220 | ||
| 221 | // Modifying an existing PM draft? |
|
| 222 | if (!empty($id_pm_draft) && !empty($draft_info)) |
|
| @@ 380-381 (lines=2) @@ | ||
| 377 | { |
|
| 378 | // Limit them to $modSettings['preview_characters'] characters |
|
| 379 | $row['first_body'] = strip_tags(strtr(parse_bbc($row['first_body'], $row['first_smileys'], $row['id_first_msg']), array('<br>' => ' '))); |
|
| 380 | if ($smcFunc['strlen']($row['first_body']) > $modSettings['preview_characters']) |
|
| 381 | $row['first_body'] = $smcFunc['substr']($row['first_body'], 0, $modSettings['preview_characters']) . '...'; |
|
| 382 | ||
| 383 | // Censor the subject and message preview. |
|
| 384 | censorText($row['first_subject']); |
|
| @@ 396-397 (lines=2) @@ | ||
| 393 | else |
|
| 394 | { |
|
| 395 | $row['last_body'] = strip_tags(strtr(parse_bbc($row['last_body'], $row['last_smileys'], $row['id_last_msg']), array('<br>' => ' '))); |
|
| 396 | if ($smcFunc['strlen']($row['last_body']) > $modSettings['preview_characters']) |
|
| 397 | $row['last_body'] = $smcFunc['substr']($row['last_body'], 0, $modSettings['preview_characters']) . '...'; |
|
| 398 | ||
| 399 | censorText($row['last_subject']); |
|
| 400 | censorText($row['last_body']); |
|
| @@ 57-58 (lines=2) @@ | ||
| 54 | censorText($row['body']); |
|
| 55 | ||
| 56 | $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled']), array('<br>' => ' '))); |
|
| 57 | if ($smcFunc['strlen']($row['body']) > 128) |
|
| 58 | $row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...'; |
|
| 59 | ||
| 60 | // Send the data. |
|
| 61 | return array( |
|
| @@ 1207-1208 (lines=2) @@ | ||
| 1204 | { |
|
| 1205 | // Limit them to 128 characters - do this FIRST because it's a lot of wasted censoring otherwise. |
|
| 1206 | $row['first_body'] = strip_tags(strtr(parse_bbc($row['first_body'], $row['first_smileys'], $row['id_first_msg']), array('<br>' => ' '))); |
|
| 1207 | if ($smcFunc['strlen']($row['first_body']) > 128) |
|
| 1208 | $row['first_body'] = $smcFunc['substr']($row['first_body'], 0, 128) . '...'; |
|
| 1209 | $row['last_body'] = strip_tags(strtr(parse_bbc($row['last_body'], $row['last_smileys'], $row['id_last_msg']), array('<br>' => ' '))); |
|
| 1210 | if ($smcFunc['strlen']($row['last_body']) > 128) |
|
| 1211 | $row['last_body'] = $smcFunc['substr']($row['last_body'], 0, 128) . '...'; |
|
| @@ 1210-1211 (lines=2) @@ | ||
| 1207 | if ($smcFunc['strlen']($row['first_body']) > 128) |
|
| 1208 | $row['first_body'] = $smcFunc['substr']($row['first_body'], 0, 128) . '...'; |
|
| 1209 | $row['last_body'] = strip_tags(strtr(parse_bbc($row['last_body'], $row['last_smileys'], $row['id_last_msg']), array('<br>' => ' '))); |
|
| 1210 | if ($smcFunc['strlen']($row['last_body']) > 128) |
|
| 1211 | $row['last_body'] = $smcFunc['substr']($row['last_body'], 0, 128) . '...'; |
|
| 1212 | ||
| 1213 | // Censor the subject and message preview. |
|
| 1214 | censorText($row['first_subject']); |
|
| @@ 62-63 (lines=2) @@ | ||
| 59 | censorText($row['body']); |
|
| 60 | ||
| 61 | $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br>' => ' '))); |
|
| 62 | if ($smcFunc['strlen']($row['body']) > 128) |
|
| 63 | $row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...'; |
|
| 64 | ||
| 65 | // Build the array. |
|
| 66 | $posts[] = array( |
|
| @@ 213-214 (lines=2) @@ | ||
| 210 | { |
|
| 211 | $_POST['custom_subject'] = strtr($smcFunc['htmltrim']($smcFunc['htmlspecialchars']($_POST['custom_subject'])), array("\r" => '', "\n" => '', "\t" => '')); |
|
| 212 | // Keep checking the length. |
|
| 213 | if ($smcFunc['strlen']($_POST['custom_subject']) > 100) |
|
| 214 | $_POST['custom_subject'] = $smcFunc['substr']($_POST['custom_subject'], 0, 100); |
|
| 215 | ||
| 216 | // If it's still valid move onwards and upwards. |
|
| 217 | if ($_POST['custom_subject'] != '') |
|
| @@ 3220-3221 (lines=2) @@ | ||
| 3217 | { |
|
| 3218 | $_POST['label'] = strtr($smcFunc['htmlspecialchars'](trim($_POST['label'])), array(',' => ',')); |
|
| 3219 | ||
| 3220 | if ($smcFunc['strlen']($_POST['label']) > 30) |
|
| 3221 | $_POST['label'] = $smcFunc['substr']($_POST['label'], 0, 30); |
|
| 3222 | if ($_POST['label'] != '') |
|
| 3223 | { |
|
| 3224 | $the_labels[] = $_POST['label']; |
|
| @@ 952-953 (lines=2) @@ | ||
| 949 | // No title? |
|
| 950 | if ($smcFunc['htmltrim']($_POST['evtitle']) === '') |
|
| 951 | fatal_lang_error('no_event_title', false); |
|
| 952 | if ($smcFunc['strlen']($_POST['evtitle']) > 100) |
|
| 953 | $_POST['evtitle'] = $smcFunc['substr']($_POST['evtitle'], 0, 100); |
|
| 954 | $_POST['evtitle'] = str_replace(';', '', $_POST['evtitle']); |
|
| 955 | } |
|
| 956 | } |
|
| @@ 559-560 (lines=2) @@ | ||
| 556 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 557 | { |
|
| 558 | $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br>' => ' '))); |
|
| 559 | if ($smcFunc['strlen']($row['body']) > 128) |
|
| 560 | $row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...'; |
|
| 561 | ||
| 562 | // Censor the subject. |
|
| 563 | censorText($row['subject']); |
|
| @@ 1871-1872 (lines=2) @@ | ||
| 1868 | $_POST['modify_reason'] = empty($_POST['modify_reason']) ? '' : strtr($smcFunc['htmlspecialchars']($_POST['modify_reason']), array("\r" => '', "\n" => '', "\t" => '')); |
|
| 1869 | ||
| 1870 | // At this point, we want to make sure the subject isn't too long. |
|
| 1871 | if ($smcFunc['strlen']($_POST['subject']) > 100) |
|
| 1872 | $_POST['subject'] = $smcFunc['substr']($_POST['subject'], 0, 100); |
|
| 1873 | ||
| 1874 | // Same with the "why did you edit this" text. |
|
| 1875 | if ($smcFunc['strlen']($_POST['modify_reason']) > 100) |
|
| @@ 1875-1876 (lines=2) @@ | ||
| 1872 | $_POST['subject'] = $smcFunc['substr']($_POST['subject'], 0, 100); |
|
| 1873 | ||
| 1874 | // Same with the "why did you edit this" text. |
|
| 1875 | if ($smcFunc['strlen']($_POST['modify_reason']) > 100) |
|
| 1876 | $_POST['modify_reason'] = $smcFunc['substr']($_POST['modify_reason'], 0, 100); |
|
| 1877 | ||
| 1878 | // Make the poll... |
|
| 1879 | if (isset($_REQUEST['poll'])) |
|
| @@ 2768-2769 (lines=2) @@ | ||
| 2765 | $_POST['subject'] = strtr($smcFunc['htmlspecialchars']($_POST['subject']), array("\r" => '', "\n" => '', "\t" => '')); |
|
| 2766 | ||
| 2767 | // Maximum number of characters. |
|
| 2768 | if ($smcFunc['strlen']($_POST['subject']) > 100) |
|
| 2769 | $_POST['subject'] = $smcFunc['substr']($_POST['subject'], 0, 100); |
|
| 2770 | } |
|
| 2771 | elseif (isset($_POST['subject'])) |
|
| 2772 | { |
|
| @@ 2828-2829 (lines=2) @@ | ||
| 2825 | $_POST['modify_reason'] = strtr($smcFunc['htmlspecialchars']($_POST['modify_reason']), array("\r" => '', "\n" => '', "\t" => '')); |
|
| 2826 | ||
| 2827 | // Maximum number of characters. |
|
| 2828 | if ($smcFunc['strlen']($_POST['modify_reason']) > 100) |
|
| 2829 | $_POST['modify_reason'] = $smcFunc['substr']($_POST['modify_reason'], 0, 100); |
|
| 2830 | } |
|
| 2831 | ||
| 2832 | if (empty($post_errors)) |
|