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

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

Hi List,

[repost from emacs-help]

* Steps to reproduce:

1. Create an account for the PicoLisp Wiki
   enter name and password and click OK

2. Login with standalone w3m


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

   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:
   W3m-document-charset: US-ASCII

* 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">
  <title>PicoLisp Wiki</title>
  <base href="http://picolisp.com/52313/"/>
  <li class="act1"><a href="56352250583933977~!start?*Menu=+3&*Tab=+1&*ID="

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)
      (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)))) [...]

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.