From 62b803e268e6631260b579e73204482a820084b5 Mon Sep 17 00:00:00 2001 From: ngosang Date: Thu, 9 Jul 2015 18:00:17 +0200 Subject: [PATCH] [Web UI] Fix empty trackers addition --- src/webui/webapplication.cpp | 7 +++++-- src/webui/www/public/properties_content.html | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index 89c553135..9a8c189bb 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -359,8 +359,11 @@ void WebApplication::action_command_addTrackers() BitTorrent::TorrentHandle *const torrent = BitTorrent::Session::instance()->findTorrent(hash); if (torrent) { QList trackers; - foreach (const QString &url, request().posts["urls"].split('\n')) - trackers << url; + foreach (QString url, request().posts["urls"].split('\n')) { + url = url.trimmed(); + if (!url.isEmpty()) + trackers << url; + } torrent->addTrackers(trackers); } } diff --git a/src/webui/www/public/properties_content.html b/src/webui/www/public/properties_content.html index 435b000de..520a28045 100644 --- a/src/webui/www/public/properties_content.html +++ b/src/webui/www/public/properties_content.html @@ -27,10 +27,10 @@ - - - - + + + +
QBT_TR(URL)QBT_TR QBT_TR(Status)QBT_TRQBT_TR(Peers)QBT_TRQBT_TR(Message)QBT_TRQBT_TR(URL)QBT_TR QBT_TR(Status)QBT_TRQBT_TR(Peers)QBT_TRQBT_TR(Message)QBT_TR