From 50435729ca8d8f49d196ad0d6fe9241ac637a020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Fri, 3 Jan 2020 00:43:13 +0100 Subject: fix --- main.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.php b/main.php index 37fcbfa..9000d31 100644 --- a/main.php +++ b/main.php @@ -194,7 +194,10 @@ Errors: $xmlDoc->loadHTML($request_loop_output); $searchNode = $xmlDoc->getElementById('CPH_bodyMain_SearchResultsStatic1_UpdatePanelSearchResults')->getElementsByTagName("a"); foreach($searchNode as $sn) { - if(startsWith($sn->getAttribute("href"), "/oseba/")) $kontakti[] = filter_var("https://www.itis.si".$sn->getAttribute("href"), FILTER_SANITIZE_STRING, FILTER_FLAG_ENCODE_HIGH); // just don't change your domain + if(startsWith($sn->getAttribute("href"), "/oseba/")) $kontakti[] = + preg_replace_callback('/[^\x20-\x7f]/', function($match) { + return urlencode($match[0]); + }, "https://www.itis.si".$sn->getAttribute("href")); // just don't change your domain } } return $kontakti; -- cgit v1.2.3