Page 1 of 1

HTML Char Ref is Not Decoded in Cooliris RSS Generator

Posted: 26 Jun 2010, 22:43
by bbchopsticks
Hi Jan,

In file: ../administrator/components/com_phocagallery/models/phocagalleryc.php
At line 500:

Please add html_entity_decode function to the statement...

Original statement:

Code: Select all

$item->appendChild( $this->_buildXMLElement( 'description', JFilterOutput::cleanText(strip_tags($vrow->description ))));
Edited statement:

Code: Select all

$item->appendChild( $this->_buildXMLElement( 'description', html_entity_decode(JFilterOutput::cleanText(strip_tags($vrow->description )))));
Reason:
Some of the html editors will encode the unicode characters with html char ref, e.g. 叶 -> 叶
And if this does happen, the generated RSS file for Cooliris will carries 叶 in the description instead of the actual character, and is subsequently displayed in Cooliris as bunch of numbers and symbols.

In case, the user database already consist of hundreds of photos with description that was entered by the aforementioned editor, it will be a very painful job to reedit each of the photo with new editor just to get rid of the encoding - not wise.

This is the case happens to my website. After reading through some posts in your forum, I finally found that the RSS generator is in the above file. I had made the modification as described above, it solves my issue.

Please consider making this change in the next release, so that it help others that face the same problem as mine. :wink:

Thanks.


PS:
BTW, thanks for the great component. Phoca Gallery is one of the greatest components that ever developed for Joomla!. :D

Re: HTML Char Ref is Not Decoded in Cooliris RSS Generator

Posted: 28 Jun 2010, 18:54
by Jan
Hi, I will take a look at it for next release.

Thank you for this info.

Jan

Re: HTML Char Ref is Not Decoded in Cooliris RSS Generator

Posted: 30 Jun 2010, 13:48
by Jan
Hi, I have tested it and there is a problem, it skip national diacritics used in UTF-8

Jan

Re: HTML Char Ref is Not Decoded in Cooliris RSS Generator

Posted: 02 Jul 2010, 13:12
by bbchopsticks
Hi Jan,

The appropriate character set must be specified for converting certain characters. Please refer...

http://php.net/manual/en/function.html- ... decode.php
http://www.w3schools.com/php/func_strin ... decode.asp

I didn't specify the character set since the default settings work for me. It is converting the html encoding in my description to simplified Chinese and Japanese characters for all the RSS file.

Perhaps for the next release, you may need to write a switcher to select the appropriate character set for user based on their locale setting in Joomla? Hope this information does help.

Thanks.