diff options
author | Andrew Dolgov <[email protected]> | 2020-05-13 12:07:31 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-05-13 12:07:31 +0300 |
commit | 7a2e9bef7724547968c94b640d7499e3f7667592 (patch) | |
tree | 64c4d4356702ffc7581f16729c38e09d69db04d7 /classes | |
parent | 5e77d0062bde3abe08fe3aadff689faa31762fe7 (diff) |
add --opml-export to update.php
Diffstat (limited to 'classes')
-rw-r--r-- | classes/opml.php | 20 |
1 files changed, 12 insertions, 8 deletions
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 = "<?xml version=\"1.0\" encoding=\"utf-8\"?".">"; @@ -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 |