From 019f4578bcb80069487c4dff7ec5c05f35b0eacd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 14 Mar 2019 09:08:44 +0300 Subject: [PATCH] fix feed icon upload not working, rework form to use FormData/ajax --- classes/pref/feeds.php | 23 ++++++----------- js/CommonDialogs.js | 56 ++++++++++++++++++++++++++---------------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index e8da85393..40bbc7ef3 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -473,6 +473,7 @@ class Pref_Feeds extends Handler_Protected { $icon_file = $tmp_file; $feed_id = clean($_REQUEST["feed_id"]); + $rc = 2; // failed if (is_file($icon_file) && $feed_id) { if (filesize($icon_file) < 65535) { @@ -492,21 +493,15 @@ class Pref_Feeds extends Handler_Protected { $rc = 0; } - } else { - $rc = 2; } } else { $rc = 1; } - } else { - $rc = 2; } if (is_file($icon_file)) @unlink($icon_file); - print ""; + print $rc; return; } @@ -766,20 +761,16 @@ class Pref_Feeds extends Handler_Protected { /* Icon */ - print ""; - - print ""; + print ""; - print "
+ print " - - + +