From 9112586eeca8ca5216d66b1820d175c12ef3cf0d Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Fri, 2 Nov 2012 15:29:41 -0400 Subject: [News] import opml from local filesystem now works --- ajax/importopml.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'ajax') 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) { -- cgit v1.2.3