]> _ Git - psq.git/commitdiff
non greedy title
authorLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 7 Sep 2020 08:14:41 +0000 (10:14 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 7 Sep 2020 08:14:41 +0000 (10:14 +0200)
app/Invokables/GetPageTitleFromUrl.php

index 479bb9e669ffa9235cf3eb21526612d9a91edeeb..33aff915360618e1fa8bedf56bc590749b3c3306 100644 (file)
@@ -34,7 +34,7 @@ class GetPageTitleFromUrl
 
         if($str !== ''){
             $str = trim(preg_replace('/\s+/', ' ', $str)); // supports line breaks inside <title>
-            preg_match("/<title>(.*)<\/title>/i",$str,$title); // ignore case
+            preg_match("/<title>(.*?)<\/title>/i",$str,$title); // ignore case
             return $title[1] ?? $url;
         }