diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-04-23 12:51:25 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-04-23 12:51:25 +0200 |
commit | 1a8210512cfe2f8454a731834871ebcbe6d42596 (patch) | |
tree | 4871356309a63e2caba8f12918890db3213bcafc /feed.php | |
parent | 48722ac855c79944285cbe8958fe5ed03bd835ed (diff) | |
download | dokuwiki-1a8210512cfe2f8454a731834871ebcbe6d42596.tar.gz dokuwiki-1a8210512cfe2f8454a731834871ebcbe6d42596.zip |
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.php | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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']){ |