After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743988 - Space in beginning/end of server address blocks connection.
Space in beginning/end of server address blocks connection.
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-04 13:40 UTC by Mikhail
Modified: 2015-03-02 22:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
connections: Trim whitespace from user input (1.62 KB, patch)
2015-03-02 22:15 UTC, Florian Müllner
committed Details | Review

Description Mikhail 2015-02-04 13:40:15 UTC
Steps to reproduce:
Enter "irc.gnome.org " as server address (for example, copypaste it with space from web)

Expectedr esult:
Polari connects to irc.gnome.org
Real result:
It does not.

Fix is a simple .trim() 

diff --git a/src/connections.js b/src/connections.js
index e361ed3..4fcc87a 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -183,7 +183,7 @@ const ConnectionDetails = new Lang.Class({
 
         let params = {
             name: this._descEntry.text.length ? this._descEntry.text : server,
-            server: server,
+            server: server.trim(),
             account: this._nickEntry.text
         };
Comment 1 Florian Müllner 2015-03-02 22:15:50 UTC
The following fix has been pushed:
68213ad connections: Trim whitespace from user input
Comment 2 Florian Müllner 2015-03-02 22:15:54 UTC
Created attachment 298352 [details] [review]
connections: Trim whitespace from user input

Surrounding whitespace may be odd-but-harmless at best, but will
cause connection problems when used with the server address.
Just trim whitespace from all entries before processing them.