XML-Error list files with german umlauts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

XML-Error list files with german umlauts

Reinhard Schneidewind
Hello,

just got an xml-error in with german umlauts and firefox. Firefox says
"not defined entity" (translated from german error message).
So I took a look at files/get_files.php and saw the problem. The
function htmlentities is used to encode special characters, but in xml
these are not specified.
Because owncloud uses utf8 as charset for the html-pages it is not
necessary to escape special characters. This means it would be
enough to escape xml-related characters (|'&', '"', "'", '<', '>','\'',)
for xml attribute values.

In this case the utf8tohtml function would be unnecessary.

Please try the attached patch with german umlauts or other special
characters and compare it with the original version.

Regards, schnere
|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get-files-xml-error.patch
Type: text/x-diff
Size: 2527 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/owncloud/attachments/20100713/0d35814e/attachment.bin 

Reply | Threaded
Open this post in threaded view
|

XML-Error list files with german umlauts

Robin Appelman
On Tuesday, July 13, 2010 19:11:51 Reinhard Schneidewind wrote:

> Hello,
>
> just got an xml-error in with german umlauts and firefox. Firefox says
> "not defined entity" (translated from german error message).
> So I took a look at files/get_files.php and saw the problem. The
> function htmlentities is used to encode special characters, but in xml
> these are not specified.
> Because owncloud uses utf8 as charset for the html-pages it is not
> necessary to escape special characters. This means it would be
> enough to escape xml-related characters (|'&', '"', "'", '<', '>','\'',)
> for xml attribute values.
>
> In this case the utf8tohtml function would be unnecessary.
>
> Please try the attached patch with german umlauts or other special
> characters and compare it with the original version.
>
> Regards, schnere
I was thinking of using json for that in the future, do you know anything
about how json handles utf8 or other non-ascii characters?

Anyway, thanks for you path, I will use it if it remains necessary

 - Robin Appelman