[Xapian-discuss] After upgrading to 1.2.5, Omega CGI shows spaces as %20 etc
Olly Betts
olly at survex.com
Sat May 14 04:27:03 BST 2011
On Tue, Apr 26, 2011 at 11:44:34AM +0530, xapian at catcons.co.uk wrote:
> After upgrading from Xapian 1.2.4 to 1.2.5, the Omega CGI shows spaces as
> %20, apostrophes as %27 etc. For example "all letters to potential
> members.doc" is now shown as "all%20letters%20to%20potential%20members.doc".
> This is with the default template "query".
This is a deliberate change in omindex - the previous behaviour was
actually a bug which broke links to files with certain characters
in:
Encode reserved characters in URLs - links to files with names
containing '#' and '?' now work.
Now as we build the URL we escape those characters which RFC 3986 says
should be escaped.
> Is it possible to configure Omega 1.2.5 to get the 1.2.4 style display?
Is this for displaying to the user, rather than in something like <a
href="...">?
I guess for that you might want to decode some, or perhaps all
%-escapes. You could do that for %20 like so:
$list{$split{$field{url},%20}, }
And you could resplit and rejoin for any others you particularly care
about, but that gets clumsy pretty quickly if there are many.
It would be fairly easy to add a $prettyurl command, if we can decide
exactly what it should do. For example, if you decode ?, #, and %, then
affected URLs can't be cut and pasted and actually work, while if you
decode byte values >= 0x80, then the encoding of filenames becomes an
issue.
Cheers,
Olly
More information about the Xapian-discuss
mailing list