summaryrefslogtreecommitdiff
path: root/feed.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-04-23 12:51:25 +0200
committerAndreas Gohr <andi@splitbrain.org>2012-04-23 12:51:25 +0200
commit1a8210512cfe2f8454a731834871ebcbe6d42596 (patch)
tree4871356309a63e2caba8f12918890db3213bcafc /feed.php
parent48722ac855c79944285cbe8958fe5ed03bd835ed (diff)
downloadrpg-1a8210512cfe2f8454a731834871ebcbe6d42596.tar.gz
rpg-1a8210512cfe2f8454a731834871ebcbe6d42596.tar.bz2
match on img tag in feed's img align replacement
this should avoid false positive matches on user content (which is already escaped at this point)
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/feed.php b/feed.php
index dafbb3c07..4e46c254d 100644
--- a/feed.php
+++ b/feed.php
@@ -325,8 +325,8 @@ function rss_buildItems(&$rss,&$data,$opt){
$content = preg_replace('/(<!-- TOC START -->).*(<!-- TOC END -->)/s','',$content);
// add alignment for images
- $content = preg_replace('/class="medialeft"/s', 'class="medialeft" align="left"', $content);
- $content = preg_replace('/class="mediaright"/s', 'class="mediaright" align="right"', $content);
+ $content = preg_replace('/(<img .*? class="medialeft")/s', '\\1 align="left"', $content);
+ $content = preg_replace('/(<img .*? class="mediaright")/s', '\\1 align="right"', $content);
// make URLs work when canonical is not set, regexp instead of rerendering!
if(!$conf['canonical']){