diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php
index 9e61e9286..8a16e32b2 100644
--- a/app/Http/Controllers/SearchController.php
+++ b/app/Http/Controllers/SearchController.php
@@ -18,6 +18,9 @@ public function index(Request $request)
$requestprovider = $request->input('provider');
$query = $request->input('q');
+ // Sanitize the query to prevent XSS
+ $query = htmlspecialchars($query, ENT_QUOTES, 'UTF-8');
+
// Validate the presence and non-emptiness of the query parameter
if (!$query || trim($query) === '') {
abort(400, 'Missing or empty query parameter');
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php
index 9817d8fae..51e979170 100644
--- a/app/Http/Controllers/SettingsController.php
+++ b/app/Http/Controllers/SettingsController.php
@@ -45,6 +45,7 @@ public function edit(int $id)
if (! is_null($setting)) {
return view('settings.edit')->with([
'setting' => $setting,
+ 'value' => $setting->value,
]);
} else {
$route = route('settings.list', []);
diff --git a/app/Search.php b/app/Search.php
index 982b9f318..0d7bdaf94 100644
--- a/app/Search.php
+++ b/app/Search.php
@@ -121,7 +121,7 @@ public static function form(): string
$output .= '';
}
$output .= '';
- $output .= '';
+ $output .= '';
$output .= '';
$output .= '';
$output .= '';
diff --git a/app/Setting.php b/app/Setting.php
index 26b8701e5..0c6dd5fdf 100644
--- a/app/Setting.php
+++ b/app/Setting.php
@@ -150,41 +150,41 @@ public function getEditValueAttribute()
switch ($this->type) {
case 'image':
$value = '';
- if (isset($this->value) && ! empty($this->value)) {
- $value .= '.
+ if (isset($this->value) && !empty($this->value)) {
+ $value .= '<a class=)
';
}
$value .= '';
- if (isset($this->value) && ! empty($this->value)) {
- $value .= ''.
- __('app.settings.reset').
+ if (isset($this->value) && !empty($this->value)) {
+ $value .= '' .
+ __('app.settings.reset') .
'';
}
-
+
break;
case 'boolean':
$checked = false;
- if (isset($this->value) && (bool) $this->value === true) {
+ if (isset($this->value) && (bool)$this->value === true) {
$checked = true;
}
$set_checked = ($checked) ? ' checked="checked"' : '';
$value = '
';
-
+
break;
case 'select':
$options = json_decode($this->options);
@@ -193,21 +193,21 @@ public function getEditValueAttribute()
}
$value = '';
break;
case 'textarea':
- $value = '';
+ $value = '';
break;
default:
- $value = '';
+ $value = '';
break;
}
-
+
return $value;
}
-
+
public function group(): BelongsTo
{
return $this->belongsTo(\App\SettingGroup::class, 'group_id');
diff --git a/config/app.php b/config/app.php
index 030e9c43b..583ad6956 100644
--- a/config/app.php
+++ b/config/app.php
@@ -5,7 +5,7 @@
return [
- 'version' => '2.7.2',
+ 'version' => '2.7.3',
'appsource' => env('APP_SOURCE', 'https://appslist.heimdall.site/'),