Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaped apostraphe in .env breaks setup and build tasks #6

Open
ShedFlu opened this issue Oct 23, 2024 · 1 comment
Open

Escaped apostraphe in .env breaks setup and build tasks #6

ShedFlu opened this issue Oct 23, 2024 · 1 comment

Comments

@ShedFlu
Copy link

ShedFlu commented Oct 23, 2024

The composer create-project command uses apostrophes ' as delimiters by default. In my case, I've added escaped apostrophes in the description during the setup process.

The setup/build task transforms the delimiters into double quotation marks " but leaves the string unchanged. The string is now malformed JSON and can no longer be processed. This leads to an error in vendor/yootheme/starter-utils/src/StringHelper.php:71 when json_decode is called.

Using double quotes would fix the issue in this case, but might lead to similar issues.
The .env-file gets read using parse_ini_file(), which is not really designed to be used with .env-files. Switching to a purpose-built parser might be better.

@hendrikbehncke
Copy link
Contributor

The Task runner reads the .env file and passes the variables as json to the placeholder function.

Unfortunately we can't influence the json here and you need to manually change the quotes for the "description" in the .env file when a single quote is needed.
Like you write changing the quotes to double quotes in general would lead to the same issue.

The parse_ini_file function is only used when the Joomla update.xml file is created, it's not involved here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants