summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-01-03 00:43:13 +0100
committerAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-01-03 00:43:13 +0100
commit50435729ca8d8f49d196ad0d6fe9241ac637a020 (patch)
treee2677a8353a36b59cb548c5c9bef073de7af4d54
parenthave fun (diff)
downloaditisclient-50435729ca8d8f49d196ad0d6fe9241ac637a020.tar
itisclient-50435729ca8d8f49d196ad0d6fe9241ac637a020.tar.gz
itisclient-50435729ca8d8f49d196ad0d6fe9241ac637a020.tar.bz2
itisclient-50435729ca8d8f49d196ad0d6fe9241ac637a020.tar.lz
itisclient-50435729ca8d8f49d196ad0d6fe9241ac637a020.tar.xz
itisclient-50435729ca8d8f49d196ad0d6fe9241ac637a020.tar.zst
itisclient-50435729ca8d8f49d196ad0d6fe9241ac637a020.zip
-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;