mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 02:04:30 -04:00
Clean input for custom css
This commit is contained in:
parent
eaedcba6d0
commit
1c89a39d56
@ -22,6 +22,14 @@ class UpdateCompanyRequest extends Request
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
private array $protected_input = [
|
||||
'client_portal_privacy_policy',
|
||||
'client_portal_terms',
|
||||
'portal_custom_footer',
|
||||
'portal_custom_css',
|
||||
'portal_custom_head'
|
||||
];
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
@ -32,6 +40,8 @@ class UpdateCompanyRequest extends Request
|
||||
return auth()->user()->can('edit', $this->company);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function rules()
|
||||
{
|
||||
$input = $this->all();
|
||||
@ -90,6 +100,14 @@ class UpdateCompanyRequest extends Request
|
||||
{
|
||||
$account = $this->company->account;
|
||||
|
||||
if(Ninja::isHosted())
|
||||
{
|
||||
foreach($this->protected_input as $protected_var)
|
||||
{
|
||||
$settings[$protected_var] = str_replace("script", "", $settings[$protected_var]);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $account->isFreeHostedClient()) {
|
||||
return $settings;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@
|
||||
@yield('footer')
|
||||
@stack('footer')
|
||||
|
||||
@if((bool) \App\Utils\Ninja::isSelfHost() && !empty($client->getSetting('portal_custom_footer')))
|
||||
@if($company && $company->account->isPaid() && !empty($client->getSetting('portal_custom_footer')))
|
||||
<div class="py-1 text-sm text-center text-white bg-primary">
|
||||
{!! $client->getSetting('portal_custom_footer') !!}
|
||||
</div>
|
||||
|
@ -164,7 +164,7 @@
|
||||
@yield('footer')
|
||||
@stack('footer')
|
||||
|
||||
@if((bool) \App\Utils\Ninja::isSelfHost() && !empty($settings->portal_custom_footer))
|
||||
@if($company && $company->account->isPaid() && !empty($settings->portal_custom_footer))
|
||||
<div class="py-1 text-sm text-center text-white bg-primary">
|
||||
{!! $settings->portal_custom_footer !!}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user