GNU bug report logs - #25445
Bug (Trunk): Redirect fails in Duckduckgo

Previous Next

Package: emacs;

Reported by: Ian Dunn <dunni <at> gnu.org>

Date: Sat, 14 Jan 2017 05:35:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 25.2

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25445 in the body.
You can then email your comments to 25445 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Sat, 14 Jan 2017 05:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ian Dunn <dunni <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 14 Jan 2017 05:35:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ian Dunn <dunni <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Bug (Trunk): Redirect fails in Duckduckgo
Date: Sat, 14 Jan 2017 00:34:24 -0500
[Message part 1 (text/plain, inline)]
    Due I believe to a change in Duckduckgo's API, eww is no longer able to work with Duckduckgo.  It appears that they are using a referrer tag with single quotes rather than double quotes.  The attached patch fixes this.

[eww.el.diff (text/x-diff, inline)]
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index d42180719d..b051c1ac85 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -501,6 +501,7 @@ Currently this means either text/html or application/xhtml+xml."
              (< eww-redirect-level 5))
     (when-let (refresh (dom-attr dom 'content))
       (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
+                (string-match "^\\([0-9]+\\) *;.*url='\\([^ ]+\\)'" refresh)
                 (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
         (let ((timeout (match-string 1 refresh))
               (url (match-string 2 refresh))
[Message part 3 (text/plain, inline)]
--
Ian Dunn

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Sat, 14 Jan 2017 07:13:02 GMT) Full text and rfc822 format available.

Message #8 received at 25445 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Ian Dunn <dunni <at> gnu.org>
Cc: 25445 <at> debbugs.gnu.org
Subject: Re: bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
Date: Sat, 14 Jan 2017 02:13:17 -0500
Ian Dunn <dunni <at> gnu.org> writes:

>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
> +                (string-match "^\\([0-9]+\\) *;.*url='\\([^ ]+\\)'" refresh)
                                                        '\\([^']+\\)'
Shouldn't there be a single quote instead of space in the square brackets?

>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Sat, 14 Jan 2017 14:35:01 GMT) Full text and rfc822 format available.

Message #11 received at 25445 <at> debbugs.gnu.org (full text, mbox):

From: Ian Dunn <dunni <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: 25445 <at> debbugs.gnu.org
Subject: Re: bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
Date: Sat, 14 Jan 2017 09:34:35 -0500
npostavs <at> users.sourceforge.net writes:

> Ian Dunn <dunni <at> gnu.org> writes:
>
>>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
>> +                (string-match "^\\([0-9]+\\) *;.*url='\\([^ ]+\\)'" refresh)
>                                                         '\\([^']+\\)'
> Shouldn't there be a single quote instead of space in the square brackets?
>
>>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
>

Yes.  I missed that when I copied it from the line below.

-- 
Ian Dunn




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Mon, 16 Jan 2017 00:35:02 GMT) Full text and rfc822 format available.

Message #14 received at 25445 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Ian Dunn <dunni <at> gnu.org>
Cc: 25445 <at> debbugs.gnu.org
Subject: Re: bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
Date: Sun, 15 Jan 2017 19:35:51 -0500
[Message part 1 (text/plain, inline)]
tags 25445 patch
quit

Right, so I guess this should actually go to emacs-25 since eww-tag-meta
seems to be a new function in 25.1.

[v1-0001-lisp-net-eww.el-eww-tag-meta-Handle-single-quoted.patch (text/x-diff, inline)]
From e1751dfb7ef5efbe1d79789f3d7b3a625dd8faab Mon Sep 17 00:00:00 2001
From: Ian Dunn <dunni <at> gnu.org>
Date: Sun, 15 Jan 2017 19:02:47 -0500
Subject: [PATCH v1] * lisp/net/eww.el (eww-tag-meta): Handle single quoted
 URLs (Bug#25445).

Copyright-paperwork-exempt: yes
---
 lisp/net/eww.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index d421807..90e7881 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -501,6 +501,7 @@ eww-tag-meta
              (< eww-redirect-level 5))
     (when-let (refresh (dom-attr dom 'content))
       (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
+                (string-match "^\\([0-9]+\\) *;.*url=\'\\([^\']+\\)\'" refresh)
                 (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
         (let ((timeout (match-string 1 refresh))
               (url (match-string 2 refresh))
-- 
2.9.3


Added tag(s) patch. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 16 Jan 2017 00:35:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Mon, 16 Jan 2017 03:34:02 GMT) Full text and rfc822 format available.

Message #19 received at 25445 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: dunni <at> gnu.org, 25445 <at> debbugs.gnu.org
Subject: Re: bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
Date: Mon, 16 Jan 2017 05:33:33 +0200
> From: npostavs <at> users.sourceforge.net
> Date: Sun, 15 Jan 2017 19:35:51 -0500
> Cc: 25445 <at> debbugs.gnu.org
> 
> Right, so I guess this should actually go to emacs-25 since eww-tag-meta
> seems to be a new function in 25.1.

Pushing to emacs-25 is fine with me, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Mon, 16 Jan 2017 04:27:01 GMT) Full text and rfc822 format available.

Message #22 received at 25445 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25445 <at> debbugs.gnu.org, dunni <at> gnu.org
Subject: Re: bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
Date: Sun, 15 Jan 2017 23:27:24 -0500
tags 25445 fixed
close 25445 25.2
quit

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: npostavs <at> users.sourceforge.net
>> Date: Sun, 15 Jan 2017 19:35:51 -0500
>> Cc: 25445 <at> debbugs.gnu.org
>> 
>> Right, so I guess this should actually go to emacs-25 since eww-tag-meta
>> seems to be a new function in 25.1.
>
> Pushing to emacs-25 is fine with me, thanks.

Done.

2017-01-15 23:24:38 -0500 24a5f57ac3206c05e3a3c19837f96327f008c071
  * lisp/net/eww.el (eww-tag-meta): Handle single quoted URLs (Bug#25445).




Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 16 Jan 2017 04:27:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.2, send any further explanations to 25445 <at> debbugs.gnu.org and Ian Dunn <dunni <at> gnu.org> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 16 Jan 2017 04:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Mon, 16 Jan 2017 18:14:02 GMT) Full text and rfc822 format available.

Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Achim Gratz <Stromeko <at> nexgo.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
Date: Mon, 16 Jan 2017 19:12:12 +0100
npostavs <at> users.sourceforge.net writes:
>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
> +                (string-match "^\\([0-9]+\\) *;.*url=\'\\([^\']+\\)\'" refresh)
>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))

Why not use a regex with alternatives and do just a single match?


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Mon, 16 Jan 2017 18:25:01 GMT) Full text and rfc822 format available.

Message #32 received at 25445 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Achim Gratz <Stromeko <at> nexgo.de>
Cc: 25445 <at> debbugs.gnu.org
Subject: Re: bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
Date: Mon, 16 Jan 2017 13:24:08 -0500
On Mon, Jan 16, 2017 at 1:12 PM, Achim Gratz <Stromeko <at> nexgo.de> wrote:
> npostavs <at> users.sourceforge.net writes:
>>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
>> +                (string-match "^\\([0-9]+\\) *;.*url=\'\\([^\']+\\)\'" refresh)
>>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
>
> Why not use a regex with alternatives and do just a single match?

Stefan made the same suggestion:
https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00268.html

I'm not entirely sure it's an improvement.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25445; Package emacs. (Mon, 16 Jan 2017 19:26:02 GMT) Full text and rfc822 format available.

Message #35 received at 25445 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: Stromeko <at> nexgo.de, 25445 <at> debbugs.gnu.org
Subject: Re: bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
Date: Mon, 16 Jan 2017 21:24:35 +0200
> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
> Date: Mon, 16 Jan 2017 13:24:08 -0500
> Cc: 25445 <at> debbugs.gnu.org
> 
> On Mon, Jan 16, 2017 at 1:12 PM, Achim Gratz <Stromeko <at> nexgo.de> wrote:
> > npostavs <at> users.sourceforge.net writes:
> >>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
> >> +                (string-match "^\\([0-9]+\\) *;.*url=\'\\([^\']+\\)\'" refresh)
> >>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
> >
> > Why not use a regex with alternatives and do just a single match?
> 
> Stefan made the same suggestion:
> https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00268.html
> 
> I'm not entirely sure it's an improvement.

Neither am I: it would make the regexp harder to interpret (for
humans).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 14 Feb 2017 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 124 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.