Skip to content

Commit c6f4b4f

Browse files
authored
fix space in env
1 parent a87aada commit c6f4b4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

App/Models/Env.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ private function readEnvFile($envFilePath)
2424
}
2525
// Parse lines in the format KEY=VALUE
2626
if (preg_match("/^([^=]+)=(.*)$/", $line, $matches)) {
27-
$envData[$matches[1]] = $matches[2]; // Store the key-value pair in the $envData array
27+
$key = trim($matches[1]);
28+
$value = trim($matches[2], "\" \n\r\t");
29+
$envData[$key] = $value; // Store the key-value pair in the $envData array
2830
}
2931
}
3032
fclose($file); // Close the environment file
@@ -40,4 +42,4 @@ public function get($key)
4042
}
4143
return null; // Return null if the key is not found
4244
}
43-
}
45+
}

0 commit comments

Comments
 (0)