diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-11-02 15:29:41 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-11-02 15:30:32 -0400 |
commit | 9112586eeca8ca5216d66b1820d175c12ef3cf0d (patch) | |
tree | fc8c97ab616ff72f07b70cc63ee260faf9b14a1c /ajax | |
parent | 6682d2e55d9b16d73a062d823ec3fa485bc725e4 (diff) |
[News] import opml from local filesystem now works
Diffstat (limited to 'ajax')
-rw-r--r-- | ajax/importopml.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ajax/importopml.php b/ajax/importopml.php index adf14e86e..3573a1069 100644 --- a/ajax/importopml.php +++ b/ajax/importopml.php @@ -24,14 +24,18 @@ function bailOut($msg) { exit(); } -if(!isset($_POST['path'])) { - bailOut($l->t('No file path was submitted.')); +if (isset($_POST['path'])) { + $raw = file_get_contents($_POST['path']); } - +elseif (isset($_FILES['file'])) { + $raw = file_get_contents($_FILES['file']['tmp_name']); +} +else { + bailOut($l->t('No file was submitted.')); +} + require_once 'news/opmlparser.php'; -$raw = file_get_contents($_POST['path']); - try { $parsed = OPMLParser::parse($raw); } catch (Exception $e) { |