diff options
-rw-r--r-- | src/HTMLParser.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index 4eb83d5..77c68cf 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -618,9 +618,10 @@ class HTMLParser * the original title. */ $curTitleWordCount = count(preg_split('/\s+/', $curTitle)); + $originalTitleWordCount = count(preg_split('/\s+/', preg_replace('/[\|\-\\\\\/>»]+/', '', $originalTitle))) - 1; if ($curTitleWordCount <= 4 && - (!$titleHadHierarchicalSeparators || $curTitleWordCount !== preg_split('/\s+/', preg_replace('/[\|\-\\\\\/>»]+/', '', $originalTitle)) - 1)) { + (!$titleHadHierarchicalSeparators || $curTitleWordCount !== $originalTitleWordCount)) { $curTitle = $originalTitle; } |