Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aGvwG-0002FS-Qc for pgadmin-hackers@arkaria.postgresql.org; Wed, 06 Jan 2016 21:48:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aGvwG-0004H5-4d for pgadmin-hackers@arkaria.postgresql.org; Wed, 06 Jan 2016 21:48:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aGvw2-0003my-6g for pgadmin-hackers@postgresql.org; Wed, 06 Jan 2016 21:48:02 +0000 Received: from palladium.wars-nicht.de ([89.238.64.91] helo=polonium.wars-nicht.de) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aGvvy-0000p0-EQ for pgadmin-hackers@postgresql.org; Wed, 06 Jan 2016 21:48:01 +0000 Received: from localhost (localhost [127.0.0.1]) by polonium.wars-nicht.de (Postfix) with ESMTP id A4A8B114037 for ; Wed, 6 Jan 2016 22:47:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at polonium X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from polonium.wars-nicht.de ([127.0.0.1]) by localhost (polonium.wars-nicht.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RfcGtOKqqY7F for ; Wed, 6 Jan 2016 22:47:56 +0100 (CET) Received: from diamond.wars-nicht.de (50-204-244-30-static.hfc.comcastbusiness.net [50.204.244.30]) by polonium.wars-nicht.de (Postfix) with ESMTPSA id 10C86114035 for ; Wed, 6 Jan 2016 22:47:56 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by diamond.wars-nicht.de (Postfix) with ESMTP id AE6691BE0716 for ; Wed, 6 Jan 2016 22:47:54 +0100 (CET) To: pgadmin-hackers@postgresql.org From: Andreas 'ads' Scherbaum Subject: CleanHelpPath & index.html Message-ID: <568D8B8A.10804@wars-nicht.de> Date: Wed, 6 Jan 2016 22:47:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060602070901040109070101" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------060602070901040109070101 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, looking into misc.cpp, around line 661, there is CleanHelpPath. When I try to add a documentation link ending with "index.html", this function incorrectly assumes that it must be a directory and adds a "/" (or whatever the current separator is). This even happens when the correct link is in ~/.pgadmin3. The link is then read from the config file, cleaned up incorrectly and when I try to open the help link, it points to the wrong URL (index.html/). Attached is a small patch which checks a string in CleanHelpPath if it ends in one of the most common file types (.htm, .html, .php and .asp) and if this is the case, the string is returned as is. Regards, -- Andreas 'ads' Scherbaum German PostgreSQL User Group European PostgreSQL User Group - Board of Directors Volunteer Regional Contact, Germany - PostgreSQL Project --------------060602070901040109070101 Content-Type: text/x-patch; name="misc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="misc.diff" diff --git a/pgadmin/utils/misc.cpp b/pgadmin/utils/misc.cpp index 93b56f8..35062c4 100644 --- a/pgadmin/utils/misc.cpp +++ b/pgadmin/utils/misc.cpp @@ -676,7 +676,14 @@ wxString CleanHelpPath(const wxString &path) thePath.Lower().EndsWith(wxT(".zip"))) return thePath; - // In all othe cases we must have a directory + // Not everything is a directory + if (thePath.Lower().EndsWith(wxT(".htm")) || + thePath.Lower().EndsWith(wxT(".html")) || + thePath.Lower().EndsWith(wxT(".php")) || + thePath.Lower().EndsWith(wxT(".asp"))) + return thePath; + + // In all other cases we must have a directory wxString sep; // Figure out the appropriate seperator @@ -763,10 +770,20 @@ void DisplayHelp(const wxString &helpTopic, const HelpType helpType) { // the old help path (stored in the settings) is no longer working static wxString gpHelpPath = settings->GetGpHelpPath(); + wxPrintf(wxT("misc.cpp: %s\n"), gpHelpPath.c_str()); + if (gpHelpPath.CmpNoCase(wxT("http://docs.gopivotal.com/gpdb/")) == 0) + { + gpHelpPath = wxT("http://gpdb.docs.pivotal.io/index.html"); + // Replace the path to the old domain with the link to + // the new documentation path + // The old link is working for now, but there is no guarantee + // that it will stay this way + settings->SetGpHelpPath(gpHelpPath); + } if (gpHelpPath.CmpNoCase(wxT("http://www.greenplum.com/docs/3300/")) == 0) { - gpHelpPath = wxT("http://docs.gopivotal.com/gpdb/"); + gpHelpPath = wxT("http://gpdb.docs.pivotal.io/index.html"); // this is the old link, update the link to the new documentation link // problem: this saves the link into the configuration file settings->SetGpHelpPath(gpHelpPath); --------------060602070901040109070101 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers --------------060602070901040109070101--