[fixed] Use joomla string functions - wrong substr now

More
12 years 8 months ago - 12 years 8 months ago #24325 by gruz
I.e. it I set to trim my titles in Russian in the mod_flexicontent I meet such a problem:
[img


The problem is that substr and strlen don't work correct with multibyte encodings. We must use joomla JString class.

So to fix it:
modules/mod_flexicontent/helper.php

Line about 340
Code:
$lists[$ord]['featured'][$i]->title = (strlen($row->title) > $cuttitle_feat) ? substr($row->title, 0, $cuttitle_feat) . '...' : $row->title;
has to be changed to
Code:
$lists[$ord]['featured'][$i]->title = (JString::strlen($row->title) > $cuttitle_feat) ? JString::substr($row->title, 0, $cuttitle_feat) . '...' : $row->title;

And then again almost the same in line about 460
Code:
$lists[$ord]['standard'][$i]->title = (strlen($row->title) > $cuttitle) ? substr($row->title, 0, $cuttitle) . '...' : $row->title;
replace with
Code:
$lists[$ord]['standard'][$i]->title = (JString::strlen($row->title) > $cuttitle) ? JString::substr($row->title, 0, $cuttitle) . '...' : $row->title;

Result:
[img

J2.5
FC - 2.0 - Rev 1612 (since 17-00 30.12.2012)
Last edit: 12 years 8 months ago by gruz.

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

More
12 years 8 months ago #24335 by micker
it is the same thing ?
code.google.com/p/flexicontent/s ... ail?r=1237

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
12 years 8 months ago #24337 by gruz
As far as I see form the text " fixed an issue in universal module not cutting item title as
multi-byte UTF8 string" - yes.

J2.5
FC - 2.0 - Rev 1612 (since 17-00 30.12.2012)

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

More
12 years 8 months ago #24339 by micker
cool

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
12 years 8 months ago #24397 by ggppdk
Yes this has been fixed in r1237


-- 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.395 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