summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-01-18 11:07:46 +0100
committerAndreas Gohr <andi@splitbrain.org>2013-01-18 11:07:46 +0100
commit903e04c3aaaad8e237d8e50434aed40692672a43 (patch)
tree0df2b7d8634237d514113a1c9169f5d232c305fe /inc
parent8b87bc02a80bd1436f031d46f2d1e167b815323a (diff)
downloadrpg-903e04c3aaaad8e237d8e50434aed40692672a43.tar.gz
rpg-903e04c3aaaad8e237d8e50434aed40692672a43.tar.bz2
correctly escape diffs in HTML mails
Diffstat (limited to 'inc')
-rw-r--r--inc/subscription.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/inc/subscription.php b/inc/subscription.php
index fc26e42e8..e4cabffed 100644
--- a/inc/subscription.php
+++ b/inc/subscription.php
@@ -398,17 +398,22 @@ class Subscription {
if($rev) {
$subject = 'changed';
$trep['OLDPAGE'] = wl($id, "rev=$rev", true, '&');
- $df = new Diff(explode("\n", rawWiki($id, $rev)),
- explode("\n", rawWiki($id)));
+
+ $old_content = rawWiki($id, $rev);
+ $new_content = rawWiki($id);
+
+ $df = new Diff(explode("\n", $old_content),
+ explode("\n", $new_content));
$dformat = new UnifiedDiffFormatter();
$tdiff = $dformat->format($df);
$DIFF_INLINESTYLES = true;
+ $df = new Diff(explode("\n", hsc($old_content)),
+ explode("\n", hsc($new_content)));
$dformat = new InlineDiffFormatter();
$hdiff = $dformat->format($df);
$hdiff = '<table>'.$hdiff.'</table>';
$DIFF_INLINESTYLES = false;
-
} else {
$subject = 'newpage';
$trep['OLDPAGE'] = '---';