From aa83a990d18d1e03a9fbb833e6c90e7396e64a00 Mon Sep 17 00:00:00 2001 From: Michael Bemmerl Date: Sun, 3 Apr 2022 08:09:42 +0000 Subject: [PATCH] [OtrkeyFinderBridge] Remove HTML in title (#2594) * [OtrkeyFinderBridge] Provide a better example that actually returns results. * [OtrkeyFinderBridge] Remove HTML in filename. --- bridges/OtrkeyFinderBridge.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bridges/OtrkeyFinderBridge.php b/bridges/OtrkeyFinderBridge.php index 5da6525b..9c5b8a2a 100644 --- a/bridges/OtrkeyFinderBridge.php +++ b/bridges/OtrkeyFinderBridge.php @@ -10,7 +10,7 @@ class OtrkeyFinderBridge extends BridgeAbstract { array( 'searchterm' => array( 'name' => 'Search term', - 'exampleValue' => 'Terminator', + 'exampleValue' => 'Tatort', 'title' => 'The search term is case-insensitive', ), 'station' => array( @@ -155,8 +155,14 @@ class OtrkeyFinderBridge extends BridgeAbstract { if ($file == null) return null; - else - return trim($file->innertext); + + // Sometimes there is HTML in the filename - we don't want that. + // To filter that out, enumerate to the node which contains the text only. + foreach($file->nodes as $node) + if ($node->nodetype == HDOM_TYPE_TEXT) + return trim($node->innertext); + + return null; } private function buildContent(simple_html_dom_node $node) {