#4: Added config setting to configure the HTML tags that are allowed in comments

This commit is contained in:
Andy Heathershaw 2018-09-24 09:12:07 +01:00
parent 90c7591c31
commit f56d989d75
4 changed files with 10 additions and 0 deletions

View File

@ -115,6 +115,7 @@ class ConfigHelper
'items_per_page_admin' => 10, 'items_per_page_admin' => 10,
'moderate_anonymous_users' => true, 'moderate_anonymous_users' => true,
'moderate_known_users' => true, 'moderate_known_users' => true,
'photo_comments_allowed_html' => 'p,div,span,a,b,i,u',
'photo_comments_thread_depth' => 3, 'photo_comments_thread_depth' => 3,
'public_statistics' => true, 'public_statistics' => true,
'recaptcha_enabled_registration' => false, 'recaptcha_enabled_registration' => false,

View File

@ -259,6 +259,7 @@ class DefaultController extends Controller
'facebook_app_secret', 'facebook_app_secret',
'google_app_id', 'google_app_id',
'google_app_secret', 'google_app_secret',
'photo_comments_allowed_html',
'photo_comments_thread_depth', 'photo_comments_thread_depth',
'sender_address', 'sender_address',
'sender_name', 'sender_name',

View File

@ -55,6 +55,8 @@ return [
'settings_allow_photo_comments_anonymous' => 'Allow anonymous users to comment on photos', 'settings_allow_photo_comments_anonymous' => 'Allow anonymous users to comment on photos',
'settings_allow_photo_comments_anonymous_help' => 'With this option enabled, users can post comments without being logged in.', 'settings_allow_photo_comments_anonymous_help' => 'With this option enabled, users can post comments without being logged in.',
'settings_allow_photo_comments_help' => 'With this option enabled, users can comment on individual photos.', 'settings_allow_photo_comments_help' => 'With this option enabled, users can comment on individual photos.',
'settings_photo_comments_allowed_html' => 'HTML tags allowed in comments:',
'settings_photo_comments_allowed_html_help' => 'Enter a comma-separated list of HTML tags (without angle brackets) that are allowed in comments. All other tags (and their content) will be removed when a comment is posted.',
'settings_photo_comments_thread_depth' => 'Maximum depth for nested comments:', 'settings_photo_comments_thread_depth' => 'Maximum depth for nested comments:',
'settings_photo_comments_thread_depth_help' => 'Set to zero to disable nested comments.', 'settings_photo_comments_thread_depth_help' => 'Set to zero to disable nested comments.',
'settings_photo_comments_require_login' => 'Require login before posting comments', 'settings_photo_comments_require_login' => 'Require login before posting comments',

View File

@ -516,6 +516,12 @@
@endif @endif
</div> </div>
<div class="form-group mt-3">
<label class="form-control-label" for="photo-comments-allowed-html">@lang('forms.settings_photo_comments_allowed_html')</label>
<textarea style="font-family: 'Lucida Console', Monaco, monospace !important;" rows="5" class="form-control{{ $errors->has('photo_comments_allowed_html') ? ' is-invalid' : '' }}" id="photo-comments-allowed-html" name="photo_comments_allowed_html">{!! old('photo_comments_allowed_html', $config['photo_comments_allowed_html']) !!}</textarea>
<small class="form-text text-muted">@lang('forms.settings_photo_comments_allowed_html_help')</small>
</div>
<hr/> <hr/>
<fieldset> <fieldset>
<legend class="mb-3"> <legend class="mb-3">