diff options
author | Friendika <info@friendika.com> | 2011-01-19 19:51:34 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-01-19 19:51:34 -0800 |
commit | 2ffe0d0b1d9589b6b37d8ade0114caef31339001 (patch) | |
tree | 7643c61b5d25671b3d79ba2d8c28fd7c9bb60b4a /boot.php | |
parent | d59585d89dc7541e57a3a5685b2835cd0904e533 (diff) | |
download | volse-hubzilla-2ffe0d0b1d9589b6b37d8ade0114caef31339001.tar.gz volse-hubzilla-2ffe0d0b1d9589b6b37d8ade0114caef31339001.tar.bz2 volse-hubzilla-2ffe0d0b1d9589b6b37d8ade0114caef31339001.zip |
do a better job of comparing same URLs.
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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; +}} |