Prechádzať zdrojové kódy

! Warning if too many groups are selected for access a certain board [Topic 476074]

emanuele 12 rokov pred
rodič
commit
d32ac97d3d

+ 3 - 0
Sources/ManageBoards.php

@@ -626,6 +626,9 @@ function EditBoard2()
 			foreach ($_POST['groups'] as $group)
 				$boardOptions['access_groups'][] = (int) $group;
 
+		if (strlen(implode(',', $boardOptions['access_groups'])) > 255)
+			fatal_lang_error('too_many_groups', false);
+
 		// Change '1 & 2' to '1 & 2', but not '&' to '&'...
 		$boardOptions['board_name'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['board_name']);
 		$boardOptions['board_description'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['desc']);

+ 1 - 0
Themes/default/languages/Errors.english.php

@@ -214,6 +214,7 @@ $txt['theme_edit_missing'] = 'The file you are trying to edit... can\'t even be
 $txt['no_dump_database'] = 'Only administrators can make database backups!';
 $txt['pm_not_yours'] = 'The personal message you\'re trying to quote is not your own or does not exist, please go back and try again.';
 $txt['mangled_post'] = 'Mangled form data - please go back and try again.';
+$txt['too_many_groups'] = 'Sorry, you selected too many groups, please remove some.';
 $txt['post_upload_error'] = 'The post data is missing. This error is can be caused by trying to submit a file larger than allowed by the server.  Please contact your administrator if this problem continues.';
 $txt['quoted_post_deleted'] = 'The post you are trying to quote either does not exist, was deleted, or is no longer viewable by you.';
 $txt['pm_too_many_per_hour'] = 'You have exceeded the limit of %1$d personal messages per hour.';