Переглянути джерело

! consistently deal with event title length

Signed-off-by: Spuds <[email protected]>
Spuds 12 роки тому
батько
коміт
24e7c0125a
2 змінених файлів з 4 додано та 4 видалено
  1. 2 2
      Sources/Calendar.php
  2. 2 2
      Sources/Subs-Calendar.php

+ 2 - 2
Sources/Calendar.php

@@ -205,7 +205,7 @@ function CalendarPost()
 			$eventOptions = array(
 				'board' => 0,
 				'topic' => 0,
-				'title' => substr($_REQUEST['evtitle'], 0, 60),
+				'title' => $smcFunc['substr']($_REQUEST['evtitle'], 0, 100),
 				'member' => $user_info['id'],
 				'start_date' => sprintf('%04d-%02d-%02d', $_POST['year'], $_POST['month'], $_POST['day']),
 				'span' => isset($_POST['span']) && $_POST['span'] > 0 ? min((int) $modSettings['cal_maxspan'], (int) $_POST['span'] - 1) : 0,
@@ -236,7 +236,7 @@ function CalendarPost()
 			}
 
 			$eventOptions = array(
-				'title' => substr($_REQUEST['evtitle'], 0, 60),
+				'title' => $smcFunc['substr']($_REQUEST['evtitle'], 0, 100),
 				'span' => empty($modSettings['cal_allowspan']) || empty($_POST['span']) || $_POST['span'] == 1 || empty($modSettings['cal_maxspan']) || $_POST['span'] > $modSettings['cal_maxspan'] ? 0 : min((int) $modSettings['cal_maxspan'], (int) $_POST['span'] - 1),
 				'start_date' => strftime('%Y-%m-%d', mktime(0, 0, 0, (int) $_REQUEST['month'], (int) $_REQUEST['day'], (int) $_REQUEST['year'])),
 			);

+ 2 - 2
Sources/Subs-Calendar.php

@@ -803,8 +803,8 @@ function validateEventPost()
 		// No title?
 		if ($smcFunc['htmltrim']($_POST['evtitle']) === '')
 			fatal_lang_error('no_event_title', false);
-		if ($smcFunc['strlen']($_POST['evtitle']) > 30)
-			$_POST['evtitle'] = $smcFunc['substr']($_POST['evtitle'], 0, 30);
+		if ($smcFunc['strlen']($_POST['evtitle']) > 100)
+			$_POST['evtitle'] = $smcFunc['substr']($_POST['evtitle'], 0, 100);
 		$_POST['evtitle'] = str_replace(';', '', $_POST['evtitle']);
 	}
 }