summaryrefslogtreecommitdiffstats
path: root/main.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.php5
1 files changed, 4 insertions, 1 deletions
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;