File tree Expand file tree Collapse file tree 5 files changed +19
-8
lines changed Expand file tree Collapse file tree 5 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -80,4 +80,8 @@ CUSTOM_META_TAGS=false
80
80
81
81
# =FORCE_HTTPS either true or false. Used to redirect any request to HTTPS.
82
82
# =Note that this will only affect port 443 if you are using the docker image.
83
- FORCE_HTTPS = false
83
+ FORCE_HTTPS = false
84
+
85
+ # =Defines wether or not themes are allowed to inject custom code.
86
+ # =Themes V2 can now implement fully custom code which you might want to disable for security reasons.
87
+ ALLOW_CUSTOM_CODE_IN_THEMES = true
Original file line number Diff line number Diff line change 13
13
if (EnvEditor:: keyExists (' MAINTENANCE_MODE' )){ /* Do nothing if key already exists */
14
14
} else {EnvEditor:: addKey (' MAINTENANCE_MODE' , ' false' );}
15
15
16
+ if (EnvEditor:: keyExists (' ALLOW_CUSTOM_CODE_IN_THEMES' )){ /* Do nothing if key already exists */
17
+ } else {EnvEditor:: addKey (' ALLOW_CUSTOM_CODE_IN_THEMES' , ' true' );}
18
+
16
19
if (! config ()-> has (' advanced-config.expand_panel_admin_menu_permanently' ) and ! config ()-> has (' disable_default_password_notice' )) {
17
20
18
21
function getStringBetween ($string , $start , $end ) {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function themeAsset($path){
23
23
return $path ;}
24
24
? >
25
25
26
- @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_head' ) == " true" )@include ($GLOBALS [' themeName' ] . ' .extra.custom-head' )@endif
26
+ @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_head' ) == " true" and env ( ' ALLOW_CUSTOM_CODE_IN_THEMES ' ) == ' true ' )@include ($GLOBALS [' themeName' ] . ' .extra.custom-head' )@endif
27
27
28
28
@include (' layouts.analytics' )
29
29
@@ -91,7 +91,7 @@ function themeAsset($path){
91
91
</head >
92
92
<body >
93
93
94
- @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_body' ) == " true" )@include ($GLOBALS [' themeName' ] . ' .extra.custom-body' )@endif
94
+ @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_body' ) == " true" and env ( ' ALLOW_CUSTOM_CODE_IN_THEMES ' ) == ' true ' )@include ($GLOBALS [' themeName' ] . ' .extra.custom-body' )@endif
95
95
96
96
@if (config (' advanced-config.home_theme' ) != ' ' and config (' advanced-config.home_theme' ) != ' default' )
97
97
<!-- Enables parallax background animations -->
@@ -234,6 +234,6 @@ function themeAsset($path){
234
234
</div >
235
235
</body >
236
236
237
- @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_body_end' ) == " true" )@include ($GLOBALS [' themeName' ] . ' .extra.custom-body-end' )@endif
237
+ @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_body_end' ) == " true" and env ( ' ALLOW_CUSTOM_CODE_IN_THEMES ' ) == ' true ' )@include ($GLOBALS [' themeName' ] . ' .extra.custom-body-end' )@endif
238
238
239
239
</html >
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function themeAsset($path){
23
23
return $path ;}
24
24
? >
25
25
26
- @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_head' ) == " true" )@include ($GLOBALS [' themeName' ] . ' .extra.custom-head' )@endif
26
+ @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_head' ) == " true" and env ( ' ALLOW_CUSTOM_CODE_IN_THEMES ' ) == ' true ' )@include ($GLOBALS [' themeName' ] . ' .extra.custom-head' )@endif
27
27
28
28
@include (' layouts.analytics' )
29
29
@@ -124,7 +124,7 @@ function themeAsset($path){
124
124
</head >
125
125
<body >
126
126
127
- @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_body' ) == " true" )@include ($GLOBALS [' themeName' ] . ' .extra.custom-body' )@endif
127
+ @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_body' ) == " true" and env ( ' ALLOW_CUSTOM_CODE_IN_THEMES ' ) == ' true ' )@include ($GLOBALS [' themeName' ] . ' .extra.custom-body' )@endif
128
128
129
129
@if ($info -> theme != ' ' and $info -> theme != ' default' )
130
130
<!-- Enables parallax background animations -->
@@ -294,7 +294,7 @@ function get_operating_system() {
294
294
</div >
295
295
</div >
296
296
297
- @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_body_end' ) == " true" )@include ($GLOBALS [' themeName' ] . ' .extra.custom-body-end' )@endif
297
+ @if (theme (' enable_custom_code' ) == " true" and theme (' enable_custom_body_end' ) == " true" and env ( ' ALLOW_CUSTOM_CODE_IN_THEMES ' ) == ' true ' )@include ($GLOBALS [' themeName' ] . ' .extra.custom-body-end' )@endif
298
298
299
299
</body >
300
300
</html >
Original file line number Diff line number Diff line change @@ -80,4 +80,8 @@ CUSTOM_META_TAGS=false
80
80
81
81
#=FORCE_HTTPS either true or false. Used to redirect any request to HTTPS.
82
82
#=Note that this will only affect port 443 if you are using the docker image.
83
- FORCE_HTTPS=false
83
+ FORCE_HTTPS=false
84
+
85
+ #=Defines wether or not themes are allowed to inject custom code.
86
+ #=Themes V2 can now implement fully custom code which you might want to disable for security reasons.
87
+ ALLOW_CUSTOM_CODE_IN_THEMES=true
You can’t perform that action at this time.
0 commit comments