aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index d458b8647..05b33abd6 100644
--- a/boot.php
+++ b/boot.php
@@ -2191,3 +2191,22 @@ function get_birthdays() {
}}
+/**
+ *
+ * Compare two URLs to see if they are the same, but ignore
+ * slight but hopefully insignificant differences such as if one
+ * is https and the other isn't, or if one is www.something and
+ * the other isn't - and also ignore case differences.
+ *
+ * Return true if the URLs match, otherwise false.
+ *
+ */
+
+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)
+ return true;
+ return false;
+}}