summaryrefslogtreecommitdiffstats
path: root/ajax
diff options
context:
space:
mode:
Diffstat (limited to 'ajax')
-rw-r--r--ajax/importopml.php14
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) {