diff options
-rw-r--r-- | main.php | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |