ezurl not valid xhtml strict 1.1

Author Message

Xavier Dutoit

Friday 20 May 2005 9:28:55 am

Hello,

In design/standard/templates/content/datatype/view/ezxmltags/link.tpl

<a href={$href|ezurl} ...

produce (for instance)

<a href="http://blabla.com/index.php?title=test&action=edit">

The & should be encoded:
<a href="http://blabla.com/index.php?title=test&amp;action=edit">
</code>

Does a |wash or |whatever filter exist to fix it ?
Shouldn't it be encoded into ezurl ?

X+

http://www.sydesy.com

rudy demo

Saturday 21 May 2005 4:07:36 am

Hi, Xavier.
I might be wrong but I think the & in the URL is valid and should not be encoded.
The XHTML validation problem cannot be located there. I checked and the XHTML standard says that URI are defined by RFC2396 and the RFC says

      reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                    "$" | ","

The "reserved" syntax class above refers to those characters that are allowed within a URI, but which may not be allowed within a particular component of the generic URI syntax; they are used as delimiters of the components described in Section 3.

Bye

kracker (the)

Saturday 21 May 2005 4:53:08 am

Actually Rudy, I think your right on that one ...

If they were encoded, wouldn't the meaning of the string change? Then no longer two variables but one?

//kracker

<i>highlander : end game</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Marek W

Saturday 21 May 2005 5:06:41 am

Nope, Xavier has right, all "&" characters in URL should be encoded as "&amp;"

http://www.w3.org/TR/xhtml1/#C_12

"C.12. Using Ampersands in Attribute Values (and Elsewhere)

In both SGML and XML, the ampersand character ("&") declares the beginning of an entity reference (e.g., &reg; for the registered trademark symbol "®"). Unfortunately, many HTML user agents have silently ignored incorrect usage of the ampersand character in HTML documents - treating ampersands that do not look like entity references as literal ampersands. XML-based user agents will not tolerate this incorrect usage, and any document that uses an ampersand incorrectly will not be "valid", and consequently will not conform to this specification. In order to ensure that documents are compatible with historical HTML user agents and XML-based user agents, ampersands used in a document that are to be treated as literal characters must be expressed themselves as an entity reference (e.g. "&amp;"). For example, when the href attribute of the a element refers to a CGI script that takes parameters, it must be expressed as http://my.site.dom/cgi-bin/myscript.pl?class=guest&amp;name=user rather than as http://my.site.dom/cgi-bin/myscript.pl?class=guest&name=user."

liu spider

Saturday 21 May 2005 7:10:07 am

I made a patch to the operator ezurl, however it is not accepted

(you can find it in the bug tracking system in this site)

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Xavier Dutoit

Saturday 21 May 2005 8:11:36 am

Thanks Marek and Liu, I was feeling a little bit lonely on that one ;)

Actually, that's mister validator.w3.org that told me it isn't valid.

About liu patch :
http://ez.no/community/bugs/ezurl_does_not_generate_valid_xhtml_1_0_for_external_link

I guess the argument saying it shouldn't be inside of ezurl but an operator is logical.

Liu, have you done it like that or did you keep the modified ezurl ?

X+

http://www.sydesy.com

liu spider

Saturday 21 May 2005 8:30:25 am

I still use the modified version in my site to make validator.w3.org happy

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.