diff options
author | Andres Rey <[email protected]> | 2017-11-22 21:06:32 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2017-11-22 21:06:32 +0000 |
commit | ce913f9016a4b6088613e1f510cf403cc032ed41 (patch) | |
tree | 1ef39dc56cbc00c0d422791b21de76019e042c63 | |
parent | d7f9aa4396ae9aa559e810f6f3321dcc5a8d1a50 (diff) | |
parent | fac2a1cb5f33288ba4f18bfb337e5189852075b4 (diff) |
Merge pull request #31 from PedroAmorim/fixUnsupportedOperandTypes
Fix "Unsupported operand types"
-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; } |