From 555de3d17b7517e96c3cc5ab0a5bf790a3e5d6af Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Fri, 7 Apr 2017 16:44:27 -0400 Subject: [PATCH] Tweak handling of alternate titles, to ensure the +1 button is always usable --- src/API/Kitsu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/API/Kitsu.php b/src/API/Kitsu.php index 6716339b..207135ea 100644 --- a/src/API/Kitsu.php +++ b/src/API/Kitsu.php @@ -219,11 +219,11 @@ class Kitsu { foreach($existingTitles as $existing) { - $isSubset = stripos($existing, $title) !== FALSE; + $isSubset = mb_stripos($existing, $title) !== FALSE; $diff = levenshtein($existing, $title); $onlydifferentCase = (mb_strtolower($existing) === mb_strtolower($title)); - if ($diff < 3 OR $isSubset OR $onlydifferentCase) + if ($diff <= 3 OR $isSubset OR $onlydifferentCase OR mb_strlen($title) > 55) { return FALSE; }