Code Duplication    Length = 12-13 lines in 2 locations

engine/lib/sites.php 1 location

@@ 58-70 (lines=13) @@
55
 *
56
 * @return mixed
57
 */
58
function get_site_by_url($url) {
59
	global $CONFIG;
60
61
	$url = sanitise_string($url);
62
63
	$row = get_data_row("SELECT * from {$CONFIG->dbprefix}sites_entity where url='$url'");
64
65
	if ($row) {
66
		return get_entity($row->guid);
67
	}
68
69
	return false;
70
}
71
72
/**
73
 * Unit tests for sites

mod/web_services/classes/ElggHMACCache.php 1 location

@@ 46-57 (lines=12) @@
43
	 *
44
	 * @return string
45
	 */
46
	public function load($key, $offset = 0, $limit = null) {
47
		global $CONFIG;
48
49
		$key = sanitise_string($key);
50
51
		$row = get_data_row("SELECT * from {$CONFIG->dbprefix}hmac_cache where hmac='$key'");
52
		if ($row) {
53
			return $row->hmac;
54
		}
55
56
		return false;
57
	}
58
59
	/**
60
	 * Invalidate a given key.