From 7a2e9bef7724547968c94b640d7499e3f7667592 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 13 May 2020 12:07:31 +0300 Subject: add --opml-export to update.php --- classes/opml.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'classes/opml.php') diff --git a/classes/opml.php b/classes/opml.php index 48db9a8a3..c4523f83f 100644 --- a/classes/opml.php +++ b/classes/opml.php @@ -125,15 +125,16 @@ class Opml extends Handler_Protected { return $out; } - function opml_export($name, $owner_uid, $hide_private_feeds = false, $include_settings = true) { + function opml_export($filename, $owner_uid, $hide_private_feeds = false, $include_settings = true, $file_output = false) { if (!$owner_uid) return; - if (!isset($_REQUEST["debug"])) { - header("Content-type: application/xml+opml"); - header("Content-Disposition: attachment; filename=" . $name ); - } else { - header("Content-type: text/xml"); - } + if (!$file_output) + if (!isset($_REQUEST["debug"])) { + header("Content-type: application/xml+opml"); + header("Content-Disposition: attachment; filename=$filename"); + } else { + header("Content-type: text/xml"); + } $out = ""; @@ -288,7 +289,10 @@ class Opml extends Handler_Protected { 'return str_repeat("\t", intval(strlen($matches[0])/2));'), $res); */ - print $res; + if ($file_output) + return file_put_contents($filename, $res) > 0; + else + print $res; } // Import -- cgit v1.2.3