Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: labels

Andras Bacsaid3c989447918
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index 2f38ff2fd7..7bb0df4891 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -883,6 +883,11 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
$this->application->save();
}
+ if (mb_detect_encoding(base64_decode($this->application->custom_labels), 'ASCII', true) === false) {
+ ray('custom_labels contains non-ascii characters');
+ $this->application->custom_labels = base64_encode(str(implode(",", generateLabelsApplication($this->application, $this->preview)))->replace(',', "\n"));
+ $this->application->save();
+ }
$labels = collect(preg_split("/\r\n|\n|\r/", base64_decode($this->application->custom_labels)));
$labels = $labels->filter(function ($value, $key) {
return !Str::startsWith($value, 'coolify.');
diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php
index a6d82c8ef1..279e556510 100644
--- a/app/Livewire/Project/Application/General.php
+++ b/app/Livewire/Project/Application/General.php
@@ -120,8 +120,8 @@ class General extends Component
$this->application->save();
}
$this->customLabels = base64_decode(data_get($this->application, 'custom_labels'));
- // Fix for non-ascii characters
- if (preg_match('~[^\x20-\x7E\t\r\n]~', $this->customLabels) > 0) {
+ // // Fix for non-ascii characters
+ if (mb_detect_encoding($this->customLabels, 'ASCII', true) === false) {
ray('custom_labels contains non-ascii characters');
$this->resetDefaultLabels(false);
}