@@ -125,8 +125,7 @@ |
||
125 | 125 | } |
126 | 126 | if (isset($this->summary->memo['count lien brisé'])) { |
127 | 127 | $suffix .= ', ⚠️️️lien brisé'; //⚠️ |
@@ -34,7 +34,7 @@ |
||
34 | 34 | // Attention : pas de post-processing (sanitize title, etc.) |
35 | 35 | $result = $trans->process($url, $summary); |
36 | 36 | } catch (Exception $e) { |
37 | - echo "EXCEPTION ". $e->getMessage().$e->getFile().$e->getLine(); |
|
37 | + echo "EXCEPTION ".$e->getMessage().$e->getFile().$e->getLine(); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | echo $result."\n"; |
@@ -274,7 +274,7 @@ |
||
274 | 274 | if (mb_strlen($text) > $maxLength) { |
275 | 275 | $spacePos = mb_strrpos(mb_substr($text, 0, $maxLength), ' '); |
276 | 276 | $spacePos = ($spacePos > ($maxLength - 12)) ? $spacePos : $maxLength; |
277 | - $text = trim(mb_substr($text, 0, $spacePos)) . self::SYMBOL_TEXT_CUT; |
|
277 | + $text = trim(mb_substr($text, 0, $spacePos)).self::SYMBOL_TEXT_CUT; |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | return $text; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | if (empty(trim($title))) { |
23 | 23 | return null; |
24 | 24 | } |
25 | - $title = str_replace(['–','—','\\'],['-','-','/'], $title); // replace em dash with hyphen |
|
25 | + $title = str_replace(['–', '—', '\\'], ['-', '-', '/'], $title); // replace em dash with hyphen |
|
26 | 26 | |
27 | 27 | $seoSegments = $this->extractSEOSegments($title); |
28 | 28 | // No SEO segmentation found |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | // remove seo segments containing same words as the website domain name |
34 | - $seoSegmentsFiltered = array_values(array_filter($seoSegments, function ($segment) use ($prettyDomainName) { |
|
34 | + $seoSegmentsFiltered = array_values(array_filter($seoSegments, function($segment) use ($prettyDomainName) { |
|
35 | 35 | // strip string after last dot in prettyDomainName : blabla.com => blabla |
36 | 36 | $domainMain = preg_replace('/\.[^.]*$/', '', $prettyDomainName); |
37 | 37 | // strip string if only 2 chars after dot : like in 'blabla.co.uk' |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | // rebuild bestTitle but keep only the first 2 SEO segments |
56 | - return trim($seoSegmentsFiltered[0]) . ' - ' . trim($seoSegmentsFiltered[1]); |
|
56 | + return trim($seoSegmentsFiltered[0]).' - '.trim($seoSegmentsFiltered[1]); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | private function extractSEOSegments(string $title): array |