From 116b9e1c1f983cc3504cb5f1bf7877a46fb502d5 Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <ben.lort@gmail.com>
Date: Mon, 6 Mar 2017 06:01:08 -0500
Subject: [PATCH] Use Probe::uri instead of probe_url()

- Moved file inclusion to enable lazy loading
---
 include/Contact.php | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/Contact.php b/include/Contact.php
index 553bf938c2..ae06ecf11b 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -1,7 +1,5 @@
 <?php
 
-require_once('include/Probe.php');
-
 // Included here for completeness, but this is a very dangerous operation.
 // It is the caller's responsibility to confirm the requestor's intent and
 // authorisation to do this.
@@ -355,6 +353,7 @@ function get_contact_details_by_addr($addr, $uid = -1) {
 				dbesc($addr));
 
 	if (!dbm::is_result($r)) {
+		require_once('include/Probe.php');
 		$data = Probe::uri($addr);
 
 		$profile = get_contact_details_by_url($data['url'], $uid);
@@ -530,8 +529,6 @@ function contacts_not_grouped($uid,$start = 0,$count = 0) {
  * @return integer Contact ID
  */
 function get_contact($url, $uid = 0, $no_update = false) {
-	require_once "include/Scrape.php";
-
 	logger("Get contact data for url ".$url." and user ".$uid." - ".App::callstack(), LOGGER_DEBUG);;
 
 	$data = array();
@@ -558,7 +555,8 @@ function get_contact($url, $uid = 0, $no_update = false) {
 		return 0;
 	}
 
-	$data = probe_url($url);
+	require_once('include/Probe.php');
+	$data = Probe::uri($url);
 	if (!$data['url']) {
 		return 0;
 	}