bug text (single quote) truncated (see sample)

More
11 years 1 month ago #40741 by fgossart
In the website
www.paysdeflandre.fr/index.php/fr/plaisirs-gourmands

You can see 'la Ferme Marc Deswarte'

The categ view displays only part of text and is bad truncated
Vente d&#...

When you open the item
vente d'asperges

Please Log in or Create an account to join the conversation.

More
11 years 1 month ago #40751 by ggppdk
Hello

UTF8 characters are 1-3 bytes,

-- FLEXIcontent text cut off function is quite smart as it detects many problems and avoids them
e.g.
it will not cut an UTF8 character halfway,
it will count string length properly,
it will add space in case of "more<some_html_tag>words" making it "more words" and not "morewords"
etc ... !!

-- in case of single quote there is a problem indeed (that is what is happening in your case)

-- you can text a fix, report back, and i will apply it to FLEXIcontent distributions:
in components/com_flexicontent/classes/flexicontent.helper.php
find about (at about line 778)
Code:
// Calculate length according to UTF-8 encoding $length = JString::strlen(htmlspecialchars( $cleantext )); // cut the text if required if ($chars) { if ($length > $chars) { $cleantext = JString::substr( htmlspecialchars($cleantext, ENT_QUOTES, 'UTF-8'), 0, $chars ).'...'; } }
and replace with
Code:
// Calculate length according to UTF-8 encoding $length = JString::strlen($cleantext); // Cut off the text if required if ($chars) { if ($length > $chars) { $cleantext = JString::substr( $cleantext, 0, $chars ).'...'; } } // Reencode HTML special characters, (but do not encode UTF8 characters) $cleantext = htmlspecialchars($cleantext, ENT_QUOTES, 'UTF-8');

PS: filter can be compacted if you want, also the can have more appearances than drop down selection, e.g. radios, or checkboxes or tag-like selection etc (see new filtering parameters in field configuation)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 1 month ago #40813 by fgossart
It's OK now good fix Thks

Please Log in or Create an account to join the conversation.

More
11 years 1 month ago #40814 by ggppdk
Hello

thanks for feedback (will include fix in next FC package) and for reporting this

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.370 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline