help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] in url-construction in `w3m-form-submit'


From: Thorsten Jolitz
Subject: [BUG] in url-construction in `w3m-form-submit'
Date: Wed, 31 Jul 2013 16:12:57 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Hi List,

[emacs-w3m isn't part of emacs, so I don't file a bug-report - right?]

* Steps to reproduce:

1. Create an account for the PicoLisp Wiki
   goto
   http://picolisp.com/5000/-2.html?*ID=$login
   enter name and password and click OK

2. Login with standalone w3m

   Goto

#+begin_src sh
   $ w3m http://wiki.picolisp.com
#+end_src

   and login via w3m - it works

3. Repeat (2.) with emacs-w3m -> error:

#+begin_quote Location:
   http://picolisp.com/56352250583933977~!start?*Menu=+3&*Tab=+1&*ID= Cannot
   retrieve URL: http://picolisp.com/56352250583933977~!start?*Menu=+3&*Tab=
   +1&*ID= (exit status: 0)
   -------------------------------------------------------------------------
   -------------------------------------------------------------------------
   Header information W3m-current-url:
   http://picolisp.com/56352250583933977~!start?*Menu=+3&*Tab=+1&*ID=
   W3m-document-charset: US-ASCII
#+end_quote


* Problem
url is incomplete:

,--------------------------------------
| http://picolisp.com/56352250583933977...
`--------------------------------------

here is the beginning of the html source of the login page:

#+begin_src html
  <!DOCTYPE html>
  <html lang="en">
  <head>
  <title>PicoLisp Wiki</title>
  <base href="http://picolisp.com/52313/"/>
  [...snip...]
  <li class="act1"><a href="56352250583933977~!start?*Menu=+3&*Tab=+1&*ID="
  title="--&gt;">Home</a></li>
#+end_src

url should be

,------------------------------------------------
| http://picolisp.com/52313/56352250583933977 ...
`------------------------------------------------

and looks like that in stand-alone w3m.

* Bug

in `w3m-form-submit' in w3m-form.el the url-handling ignores the base href:

#+begin_src emacs-lisp
  (defun w3m-form-submit (form &optional id name value new-session download)
    [...snip...]
      (let* ((orig-url w3m-current-url)
             (url (or (w3m-form-action form)
                      (if (string-match "\\?" w3m-current-url)
                          (substring w3m-current-url 0 (match-beginning 0))
                        w3m-current-url)))) [...]
#+end_src

This line

,--------------------------------
| (url (or (w3m-form-action form)
`--------------------------------

should be changed to something that treats the href in the form as relative,
when <base href=...> is given, and concatenates it with its base.

--
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]