summaryrefslogtreecommitdiff
path: root/model/Article.php
diff options
context:
space:
mode:
Diffstat (limited to 'model/Article.php')
-rw-r--r--model/Article.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/model/Article.php b/model/Article.php
index 39fbbe4..6086b3e 100644
--- a/model/Article.php
+++ b/model/Article.php
@@ -51,10 +51,13 @@ class Article
51 51
52 private function makeHtmlMiniImages($content) 52 private function makeHtmlMiniImages($content)
53 { 53 {
54 while(preg_match('#<img src=.*/images/.*>#', $content)) 54 // on match tant qu'on trouve "/images/"
55 while(preg_match('#<img src=.+/images/.+>#', $content))
55 { 56 {
56 $pattern = '#(<img src=.*/)(images)(/.*>)#'; 57 // ? => mode paresseux, on fait matcher le moins d'occurences possibles
57 $content = preg_replace($pattern, '$1$2-mini$3', $content); 58 $pattern = '#(<img src=.+/)(images)(/.+?)(\.jpg.+>)#';
59 // insérer -mini au nom du dossier et au fichier
60 $content = preg_replace($pattern, '$1$2-mini$3-mini$4', $content);
58 } 61 }
59 62
60 return $content; 63 return $content;