$id, 'NEWPAGE' => wl($id, $current_rev ? ('rev=' . $current_rev) : '', true, '&'), 'SUMMARY' => $summary, 'SUBSCRIBE' => wl($id, ['do' => 'subscribe'], true, '&'), ]; $hrep = []; if ($rev) { $subject = 'changed'; $trep['OLDPAGE'] = wl($id, "rev=$rev", true, '&'); $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", $old_content), explode("\n", $new_content) ); $dformat = new InlineDiffFormatter(); $hdiff = $dformat->format($df); $hdiff = '' . $hdiff . '
'; $DIFF_INLINESTYLES = false; } else { $subject = 'newpage'; $trep['OLDPAGE'] = '---'; $tdiff = rawWiki($id); $hdiff = nl2br(hsc($tdiff)); } $trep['DIFF'] = $tdiff; $hrep['DIFF'] = $hdiff; $headers = ['Message-Id' => $this->getMessageID($id)]; if ($rev) { $headers['In-Reply-To'] = $this->getMessageID($id, $rev); } return $this->send( $subscriber_mail, $subject, $id, $template, $trep, $hrep, $headers ); } }