Skip to content

Commit 38d6d64

Browse files
committed
Enabled optional use of custom HTML for ll page
Enabled users to use custom HTML formatting for their personal page descriptions. Due to security reasons, this option is turned off by default. This setting can be enabled in the config.
1 parent 7e74f2b commit 38d6d64

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.env

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Email verification=Changes if users have to verify their email after registration.
22
#=REGISTER_AUTH either auth or verified. If auth is selected, no verification is required. Default is verified.
3-
REGISTER_AUTH=verified
3+
REGISTER_AUTH=auth
44

55
#Internal notifications=Changes if certain messages should be displayed or not.
66
#=NOTIFY_EVENTS notifies admins if an important event is happening, such as polls about the future of this project or security vulnerabilities.
@@ -15,10 +15,15 @@ DISPLAY_CREDIT=true
1515
#=(e.g. 'admin' without the '@')
1616
HOME_URL=
1717

18+
#ALLOW_USER_HTML=Changes if users are able to use custom HTML in their descriptions. Allows for more customized texts.
19+
#=Either true or false. USE WITH CAUTION! If true, this enables users to use custom code, including JavaScript.
20+
#=It is recommended to only turn this option on if you trust your users or only use this instance for yourself.
21+
ALLOW_USER_HTML=false
22+
1823
#App Settings=Changes settings regarding your LittleLink Custom installation. You probably only want to change the App Name setting.
1924
#=App_Name changes the displayed name for the App in the title, for example.
2025
APP_NAME="LittleLink Custom"
21-
APP_KEY=
26+
APP_KEY=base64:YUFWn5swwXryVBujHaOdiPqNvLEsC7RZs8df3rb/DJs=
2227
#=The APP_URL should be left empty under most circumstances. This setting is not required for LittleLink Custom, and you should only change this if required for your setup.
2328
APP_URL=
2429

resources/views/littlelink.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function get_operating_system() {
147147
<h1 class="fadein">{{ $info->name }}</h1>
148148

149149
<!-- Short Bio -->
150-
<center><p style="width: 50%; min-width: 300px;" class="fadein">{{ $info->littlelink_description }}</p></center>
150+
<center><p style="width: 50%; min-width: 300px;" class="fadein">@if(env('ALLOW_USER_HTML') === true){!! $info->littlelink_description !!}@else{{ $info->littlelink_description }}@endif</p></center>
151151

152152
@endforeach
153153
<!-- Buttons -->

resources/views/studio/page.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
@section('content')
44

5+
@if(env('ALLOW_USER_HTML') === true) <script src="{{ asset('resources/ckeditor/ckeditor.js') }}"></script> @endif
6+
57
<h2 class="mb-4"><i class="bi bi-file-earmark-break"> Page</i></h2>
68

79
<form action="{{ route('editPage') }}" enctype="multipart/form-data" method="post">
@@ -41,7 +43,7 @@
4143

4244
<div class="form-group col-lg-8">
4345
<label>Page Description</label>
44-
<textarea class="form-control" name="pageDescription" rows="3">{{ $page->littlelink_description ?? '' }}</textarea>
46+
<textarea class="form-control @if(env('ALLOW_USER_HTML') === true) ckeditor @endif" name="pageDescription" rows="3">{{ $page->littlelink_description ?? '' }}</textarea>
4547
</div>
4648
@endforeach
4749
<button type="submit" class="mt-3 ml-3 btn btn-info">Submit</button>

storage/backups/default_settings

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ DISPLAY_CREDIT=true
1515
#=(e.g. 'admin' without the '@')
1616
HOME_URL=
1717

18+
#ALLOW_USER_HTML=Changes if users are able to use custom HTML in their descriptions. Allows for more customized texts.
19+
#=Either true or false. USE WITH CAUTION! If true, this enables users to use custom code, including JavaScript.
20+
#=It is recommended to only turn this option on if you trust your users or only use this instance for yourself.
21+
ALLOW_USER_HTML=false
22+
1823
#App Settings=Changes settings regarding your LittleLink Custom installation. You probably only want to change the App Name setting.
1924
#=App_Name changes the displayed name for the App in the title, for example.
2025
APP_NAME="LittleLink Custom"

0 commit comments

Comments
 (0)