From 58038e82725876a19baa8ebf6f0d7208bee89b63 Mon Sep 17 00:00:00 2001 From: Damien Date: Tue, 8 Oct 2024 15:31:09 -0400 Subject: [PATCH] Strip tags in EDS getAllSubjectHeadingsFlattened --- module/VuFind/src/VuFind/RecordDriver/EDS.php | 2 +- .../tests/unit-tests/src/VuFindTest/RecordDriver/EDSTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/VuFind/src/VuFind/RecordDriver/EDS.php b/module/VuFind/src/VuFind/RecordDriver/EDS.php index 549eb607143..f9387df2f02 100644 --- a/module/VuFind/src/VuFind/RecordDriver/EDS.php +++ b/module/VuFind/src/VuFind/RecordDriver/EDS.php @@ -451,7 +451,7 @@ public function getAllSubjectHeadingsFlattened() { $subject_arrays = array_map( function ($data) { - return explode(', ', $data['Data']); + return explode(', ', rtrim(strip_tags($data['Data']), '.')); }, $this->getItems(null, null, 'Su') ); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/EDSTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/EDSTest.php index f2f23059d23..655a34a1596 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/EDSTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/EDSTest.php @@ -573,8 +573,8 @@ public function testGetAllSubjectHeadingsFlattened(): void $driver = $this->getDriver('valid-eds-record'); $this->assertEquals( [ - 'PSYCHOTHERAPY', - 'METAPHOR.', + 'PSYCHOTHERAPY', + 'METAPHOR', ], $driver->getAllSubjectHeadingsFlattened() );