From 47c31c8b03c0238fe10dce78b0ad213dad15e5a5 Mon Sep 17 00:00:00 2001 From: ngosang Date: Thu, 9 Jul 2015 10:18:45 +0200 Subject: [PATCH] [Web UI] Ports between 1 and 65535 as in the GUI. Closes #1602 --- src/webui/extra_translations.h | 4 ++-- src/webui/www/public/preferences_content.html | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/webui/extra_translations.h b/src/webui/extra_translations.h index f0a11ea58..23b50a3da 100644 --- a/src/webui/extra_translations.h +++ b/src/webui/extra_translations.h @@ -54,8 +54,8 @@ static const char *__TRANSLATIONS__[] = { QT_TRANSLATE_NOOP("HttpServer", "Maximum number of upload slots per torrent limit must be greater than 0 or disabled."), QT_TRANSLATE_NOOP("HttpServer", "Unable to save program preferences, qBittorrent is probably unreachable."), QT_TRANSLATE_NOOP("HttpServer", "Language"), - QT_TRANSLATE_NOOP("HttpServer", "The port used for incoming connections must be greater than 1024 and less than 65535."), - QT_TRANSLATE_NOOP("HttpServer", "The port used for the Web UI must be greater than 1024 and less than 65535."), + QT_TRANSLATE_NOOP("HttpServer", "The port used for incoming connections must be between 1 and 65535."), + QT_TRANSLATE_NOOP("HttpServer", "The port used for the Web UI must be between 1 and 65535."), QT_TRANSLATE_NOOP("HttpServer", "The Web UI username must be at least 3 characters long."), QT_TRANSLATE_NOOP("HttpServer", "The Web UI password must be at least 3 characters long."), QT_TRANSLATE_NOOP("HttpServer", "Save"), diff --git a/src/webui/www/public/preferences_content.html b/src/webui/www/public/preferences_content.html index 7dc4536a3..ed35a1fb9 100644 --- a/src/webui/www/public/preferences_content.html +++ b/src/webui/www/public/preferences_content.html @@ -972,8 +972,8 @@ applyPreferences = function() { // Connection tab // Listening Port var listen_port = $('port_value').getProperty('value').toInt(); - if(isNaN(listen_port) || listen_port <= 1024 || listen_port > 65535) { - alert("QBT_TR(The port used for incoming connections must be greater than 1024 and less than 65535.)QBT_TR"); + if(isNaN(listen_port) || listen_port < 1 || listen_port > 65535) { + alert("QBT_TR(The port used for incoming connections must be between 1 and 65535.)QBT_TR"); return; } settings.set('listen_port', listen_port); @@ -1163,8 +1163,8 @@ applyPreferences = function() { // HTTP Server var web_ui_port = $('webui_port_value').getProperty('value').toInt(); - if(isNaN(web_ui_port) || web_ui_port <= 1024 || web_ui_port > 65535) { - alert("QBT_TR(The port used for the Web UI must be greater than 1024 and less than 65535.)QBT_TR"); + if(isNaN(web_ui_port) || web_ui_port < 1 || web_ui_port > 65535) { + alert("QBT_TR(The port used for the Web UI must be between 1 and 65535.)QBT_TR"); return; } settings.set('web_ui_port', web_ui_port);