Skip to content

Commit 8a3dc92

Browse files
authored
Merge pull request #258 from Art4/233-patch-xml-element-error
Handle xml entities in time_entry comments correct
2 parents 74bf442 + fb3d352 commit 8a3dc92

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Redmine/Api/TimeEntry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function create(array $params = [])
7878
if ('custom_fields' === $k && is_array($v)) {
7979
$this->attachCustomFieldXML($xml, $v);
8080
} else {
81-
$xml->addChild($k, $v);
81+
$xml->addChild($k, htmlspecialchars($v));
8282
}
8383
}
8484

tests/Unit/Api/TimeEntryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ public function testCreateCallsPost()
232232
'issue_id' => '15',
233233
'project_id' => '25',
234234
'hours' => '5.25',
235+
'comments' => 'some text with xml entities: & < > " \' ',
235236
'custom_fields' => [
236237
[
237238
'id' => 1,

0 commit comments

Comments
 (0)