Skip to content

Commit

Permalink
Fixed removing quotes from values, so that this is only done where t…
Browse files Browse the repository at this point in the history
…he line starts/and ends with the same quote.
  • Loading branch information
jamielsharief committed Jan 29, 2021
1 parent 8af7c69 commit f956517
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.3] - 2021-01-29

### Fixed

- Fixed removing quotes from values, so that this is only done where the line starts/and ends with the same quote.

## [2.1.2] - 2021-01-29

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion src/YamlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ protected function castValue($value)
return '';
}

return trim($value, '"\''); // remove quotes spaces etc
// Remove quotes if they have start and finish
return preg_replace('/^(\'(.*)\'|"(.*)")$/', '$2$3', trim($value));
}
}

0 comments on commit f956517

Please sign in to comment.