aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-05-06 06:30:33 -0700
committerFriendika <info@friendika.com>2011-05-06 06:30:33 -0700
commit2c63b65e3c66bcb0a047ce51c04d23376aa6c525 (patch)
treeabb642c3bed1d6fb0ab9ce8bc26b6e37b9aa905c /boot.php
parent34f3cb68a67110fc75fedca7e5aeb70ab3f9aa4f (diff)
downloadvolse-hubzilla-2c63b65e3c66bcb0a047ce51c04d23376aa6c525.tar.gz
volse-hubzilla-2c63b65e3c66bcb0a047ce51c04d23376aa6c525.tar.bz2
volse-hubzilla-2c63b65e3c66bcb0a047ce51c04d23376aa6c525.zip
refactor "which link to show" logic
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/boot.php b/boot.php
index b3dd8635c..ad3a76e8e 100644
--- a/boot.php
+++ b/boot.php
@@ -212,6 +212,7 @@ class App {
public $user;
public $cid;
public $contact;
+ public $contacts;
public $page_contact;
public $content;
public $data;
@@ -2454,6 +2455,13 @@ function get_birthdays() {
}}
+
+if(! function_exists('normalise_link')) {
+function normalise_link($url) {
+ $ret = str_replace(array('https:','//www.'), array('http:','//'), $url);
+ return(rtrim($ret,'/'));
+}}
+
/**
*
* Compare two URLs to see if they are the same, but ignore
@@ -2467,9 +2475,7 @@ function get_birthdays() {
if(! function_exists('link_compare')) {
function link_compare($a,$b) {
- $a1 = str_replace(array('https:','//www.'), array('http:','//'), $a);
- $b1 = str_replace(array('https:','//www.'), array('http:','//'), $b);
- if(strcasecmp($a1,$b1) === 0)
+ if(strcasecmp(normalise_link($a),normalise_link($b)) === 0)
return true;
return false;
}}