mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 21:20:29 +00:00
fix(api): encoding checks (#7944)
This commit is contained in:
@@ -389,7 +389,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$postgresConf = base64_decode($request->postgres_conf);
|
||||
if (mb_detect_encoding($postgresConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($postgresConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -429,7 +429,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$redisConf = base64_decode($request->redis_conf);
|
||||
if (mb_detect_encoding($redisConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($redisConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -456,7 +456,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$keydbConf = base64_decode($request->keydb_conf);
|
||||
if (mb_detect_encoding($keydbConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($keydbConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -486,7 +486,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$mariadbConf = base64_decode($request->mariadb_conf);
|
||||
if (mb_detect_encoding($mariadbConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($mariadbConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -515,7 +515,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$mongoConf = base64_decode($request->mongo_conf);
|
||||
if (mb_detect_encoding($mongoConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($mongoConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -546,7 +546,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$mysqlConf = base64_decode($request->mysql_conf);
|
||||
if (mb_detect_encoding($mysqlConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($mysqlConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -1701,7 +1701,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$postgresConf = base64_decode($request->postgres_conf);
|
||||
if (mb_detect_encoding($postgresConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($postgresConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -1756,7 +1756,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$mariadbConf = base64_decode($request->mariadb_conf);
|
||||
if (mb_detect_encoding($mariadbConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($mariadbConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -1815,7 +1815,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$mysqlConf = base64_decode($request->mysql_conf);
|
||||
if (mb_detect_encoding($mysqlConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($mysqlConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -1871,7 +1871,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$redisConf = base64_decode($request->redis_conf);
|
||||
if (mb_detect_encoding($redisConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($redisConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -1957,7 +1957,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$keydbConf = base64_decode($request->keydb_conf);
|
||||
if (mb_detect_encoding($keydbConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($keydbConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
@@ -2051,7 +2051,7 @@ class DatabasesController extends Controller
|
||||
], 422);
|
||||
}
|
||||
$mongoConf = base64_decode($request->mongo_conf);
|
||||
if (mb_detect_encoding($mongoConf, 'ASCII', true) === false) {
|
||||
if (mb_detect_encoding($mongoConf, 'UTF-8', true) === false) {
|
||||
return response()->json([
|
||||
'message' => 'Validation failed.',
|
||||
'errors' => [
|
||||
|
||||
Reference in New Issue
Block a user