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

FIX Add quotes to constants in YAML to ensure syntax validity #6659

Merged

Conversation

robbieaverill
Copy link
Contributor

Resolves #6574

I didn't add a PHPUnit 5.7 build just yet.

// Evaluate constants surrounded by back ticks
if (preg_match('/^`(?<name>[^`]+)`$/', $value, $matches)) {
// Evaluate constants surrounded by back ticks (and quotes)
if (preg_match('/^[\'"]?`(?<name>[^`]+)`[\'"]?$/', $value, $matches)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you quote the yml string it will come out unquoted when parsed by the yml parser. You shouldn't be looking for an extra layer of quotes here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True! D'oh!

@robbieaverill robbieaverill force-pushed the bugfix/quote-constants-in-yaml branch from 458ea65 to badf7d3 Compare February 27, 2017 08:48
@tractorcow tractorcow closed this Feb 28, 2017
@tractorcow tractorcow reopened this Feb 28, 2017
@tractorcow
Copy link
Contributor

Can merge on green.

@kinglozzer
Copy link
Member

LGTM 👍

@kinglozzer kinglozzer merged commit b9da55c into silverstripe:master Feb 28, 2017
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

Successfully merging this pull request may close these issues.

3 participants