diff --git a/toreadapi.php b/toreadapi.php index 2063869..d8f2f5e 100644 --- a/toreadapi.php +++ b/toreadapi.php @@ -257,7 +257,9 @@ function postEntry() { } // Save the . - if (preg_match("#<title[^>]*>(.*)#iU", $result, $matches) + $cleanedHtml = preg_replace('##isU', '', $result); + $cleanedHtml = preg_replace('##isU', '', $cleanedHtml); + if (preg_match("#]*>(.*)#iU", $cleanedHtml, $matches) and $matches[1] != "") { $title = mb_substr($matches[1], 0, $maxTitleLength, 'UTF-8');