Some more checks that the gcontact table contains valid data

This commit is contained in:
Michael Vogel 2016-04-20 07:00:55 +02:00 committed by Roland Haeder
parent 1627401cfa
commit 5efd25a0eb
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
3 changed files with 24 additions and 4 deletions

View file

@ -799,6 +799,9 @@ function probe_url($url, $mode = PROBE_NORMAL, $level = 1) {
if (substr($baseurl, -10) == "/index.php")
$baseurl = str_replace("/index.php", "", $baseurl);
if ($network == "")
$network = NETWORK_PHANTOM;
$baseurl = rtrim($baseurl, "/");
if(strpos($url,'@') AND ($addr == "") AND ($network == NETWORK_DFRN))
@ -846,7 +849,7 @@ function probe_url($url, $mode = PROBE_NORMAL, $level = 1) {
}
// Only store into the cache if the value seems to be valid
if (!in_array($result['network'], array(NETWORK_PHANTOM, ""))) {
if ($result['network'] != NETWORK_PHANTOM) {
Cache::set("probe_url:".$mode.":".$original_url,serialize($result), CACHE_DAY);
/// @todo temporary fix - we need a real contact update function that updates only changing fields