Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/46'
Browse files Browse the repository at this point in the history
Close #46
Fixes #45
  • Loading branch information
weierophinney committed Jan 9, 2019
2 parents b591f4e + 8e9035f commit ce64d54
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Expand Up @@ -33,6 +33,15 @@ matrix:
- php: 7.2
env:
- DEPS=latest
- php: 7.3
env:
- DEPS=lowest
- php: 7.3
env:
- DEPS=locked
- php: 7.3
env:
- DEPS=latest

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file, in reverse

Versions 0.3.0 and prior were released as "weierophinney/problem-details".

## 1.0.2 - TBD
## 1.0.2 - 2019-01-09

### Added

Expand All @@ -24,7 +24,8 @@ Versions 0.3.0 and prior were released as "weierophinney/problem-details".

### Fixed

- Nothing.
- [#46](https://github.com/zendframework/zend-problem-details/pull/46) adds code to ensure newlines are stripped when creating key names for XML
payloads.

## 1.0.1 - 2018-07-25

Expand Down
1 change: 1 addition & 0 deletions src/ProblemDetailsResponseFactory.php
Expand Up @@ -318,6 +318,7 @@ private function cleanKeysForXml(array $input): array
{
$return = [];
foreach ($input as $key => $value) {
$key = str_replace("\n", '_', $key);
$startCharacterPattern =
'[A-Z]|_|[a-z]|[\xC0-\xD6]|[\xD8-\xF6]|[\xF8-\x{2FF}]|[\x{370}-\x{37D}]|[\x{37F}-\x{1FFF}]|'
. '[\x{200C}-\x{200D}]|[\x{2070}-\x{218F}]|[\x{2C00}-\x{2FEF}]|[\x{3001}-\x{D7FF}]|[\x{F900}-\x{FDCF}]'
Expand Down
10 changes: 7 additions & 3 deletions test/ProblemDetailsResponseFactoryTest.php
Expand Up @@ -150,9 +150,11 @@ public function testCreateResponseRemovesInvalidCharactersFromXmlKeys(string $he

$additional = [
'foo' => [
'A#-' => 'foo',
'-A-' => 'foo',
'#B-' => 'foo',
'A#-' => 'foo',
'-A-' => 'foo',
'#B-' => 'foo',
"C\n-" => 'foo',
chr(10) . 'C-' => 'foo',
],
];

Expand All @@ -161,6 +163,8 @@ public function testCreateResponseRemovesInvalidCharactersFromXmlKeys(string $he
'A_-',
'_A-',
'_B-',
'C_-',
'_C-',
];
} else {
$expectedKeyNames = array_keys($additional['foo']);
Expand Down

0 comments on commit ce64d54

Please sign in to comment.