Bug 113077 - [PATCH] "Malformed URL" on back button
Summary: [PATCH] "Malformed URL" on back button
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 113408 114735 125666 128106 133042 140784 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-22 17:00 UTC by Dominik Karall
Modified: 2008-09-19 14:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
errormsg screenshot (81.31 KB, image/jpeg)
2007-05-27 17:52 UTC, J Appel
Details
proposed patch (551 bytes, patch)
2007-06-03 15:08 UTC, Philip Rodrigues
Details
more general patch to avoid creating empty history entries (1.02 KB, patch)
2008-02-05 12:11 UTC, Marcel Partap
Details
real fix: do not first open empty tab, then goto url instead open url straight away (1.22 KB, patch)
2008-02-06 14:54 UTC, Marcel Partap
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Karall 2005-09-22 17:00:14 UTC
Version:           3.4.91 (using KDE KDE 3.4.90)
Installed from:    Gentoo Packages

this bug is in KDE 3.5 beta1!

1. open konqueror
2. goto www.toto.tk
3. click on the back button (which shouldn't be there, or? cause we started with a blank site in konqueror) before the 15s left
4. "Malformed URL ." message appears
Comment 1 Thiago Macieira 2005-09-23 02:41:17 UTC
Confirmed on KDE 3.5 r449049.

I believe this is the same error as bug #112875
Comment 2 Thiago Macieira 2005-10-20 12:48:13 UTC
*** Bug 114735 has been marked as a duplicate of this bug. ***
Comment 3 Tommi Tervo 2005-11-16 13:35:11 UTC
*** Bug 113408 has been marked as a duplicate of this bug. ***
Comment 4 Dirk Stoecker 2006-08-21 17:39:38 UTC
Bug is still there in KDE 3.5.4.

Test case: http://www.amazon.de/gp/product/0553288105/ Click on the image of the book to get bigger view (opening new links in tabs must be enabled). The bigger image page has an illegal back button.
Comment 5 Tommi Tervo 2006-08-27 11:38:34 UTC
*** Bug 133042 has been marked as a duplicate of this bug. ***
Comment 6 Bram Schoenmakers 2006-12-14 17:10:11 UTC
*** Bug 125666 has been marked as a duplicate of this bug. ***
Comment 7 Bram Schoenmakers 2006-12-14 17:11:05 UTC
*** Bug 128106 has been marked as a duplicate of this bug. ***
Comment 8 Philip Rodrigues 2007-01-29 22:02:11 UTC
*** Bug 140784 has been marked as a duplicate of this bug. ***
Comment 9 J Appel 2007-05-27 17:52:24 UTC
Created attachment 20702 [details]
errormsg screenshot

present in KDE 3.5.7, example (hopefully) with screenie:

preparation: 

configure Konqueror to "open links in new tab instead of new window"

goto:

www.kde-apps.org

a) choose an entry
b) click on the preview-screenie (1)
new window opens in tab and offers to go back in history -> click the back
butten (2)
c) a fancy error message appears twice. (3)
Comment 10 Philip Rodrigues 2007-06-03 15:06:45 UTC
This patch appears to fix the problem (to be applied in kdebase/konqueror):


Index: konq_view.cc
===================================================================
--- konq_view.cc        (revision 655366)
+++ konq_view.cc        (working copy)
@@ -728,7 +728,9 @@
 #ifdef DEBUG_HISTORY
     kdDebug(1202) << "Append a new entry" << endl;
 #endif
-    m_lstHistory.append( new HistoryEntry ); // made current
+    if (m_sLocationBarURL != "") {
+      m_lstHistory.append( new HistoryEntry ); // made current
+    }
 #ifdef DEBUG_HISTORY
     kdDebug(1202) << "at=" << m_lstHistory.at() << " count=" << m_lstHistory.count() << endl;
 #endif
Comment 11 Philip Rodrigues 2007-06-03 15:08:31 UTC
Created attachment 20770 [details]
proposed patch

Attaching the patch for ease of saving
Comment 12 Marcel Partap 2008-02-05 12:11:01 UTC
Created attachment 23427 [details]
more general patch to avoid creating empty history entries

I also wanted to report this.. now I created a patch against trunk and hope it
is accepted for inclusion..
Comment 13 Marcel Partap 2008-02-06 14:54:14 UTC
Created attachment 23441 [details]
real fix: do not first open empty tab, then goto url instead open url straight away

Do NOT try this at home kids. My previous patch is extremly wrong and crashes
badly. I am so sorry and hereby pledge to never unleash untested patches onto
the net.
Here's one against libs/ecma/kjs_window.cpp that actually fixes the source of
the symptom. Will try and eradicate that malformed url thing later on.
Comment 14 Marcel Partap 2008-04-18 12:50:54 UTC
running with this patch since weeks, fixes the problem without side effects, could someone please review and commit this so i can clean my local tree..cheers!
Comment 15 FiNeX 2008-05-05 14:21:34 UTC
Bug reproduced on 3.5.9 AND 4.1 (trunk r802881).
Comment 16 Dominik Tritscher 2008-08-24 10:28:18 UTC
@Finex: How exactly did you manage to reproduce that with 4.1? I tried it myself, and konqueror didn't show any error.
This what I did:
1. Set konqueror to start with a blank page
2. Start a new konq instance
3. got to www.toto.tk
4. the back button is displayed, hitting it goes back to the blank page. this of course also works with any start page other than a blank page.
I also tried to directly go to the above url by launching konqueror with the url as parameter from klauncher. In that case the back button is not displayed.
So I consider this issue fixed for 4.1
Comment 17 FiNeX 2008-08-24 23:58:20 UTC
Oh, thanks Dominik to have tested it. It's true, it has been fixed recently (On KDE4, of course).

I'm closing it.
Comment 18 Marcel Partap 2008-09-19 14:46:58 UTC
What about patch in #23441? Although this problem itself is fixed, this patch would still improve the code, wouldn't it? Why first open a window with an empty URL
p->browserExtension()->createNewWindow(KUrl(), args, browserArgs, winargs, &newPart);
and only after that khtmlpart->browserExtension()->openUrlRequest(url, args, browserArgs); ? I've been running with this patch attached since half a year without a problem..
?