Usernames get wrong encoding (Lithuanian language)

18 years 4 months ago #1035 by feddyups
OK, so to get this even clearer:

1. go to

components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php and components/com_comprofiler/plugin/user/plug_cbcore/cb.connections.php

REPLACE all occurences of
htmlentities
with
htmlspecialchars


2/ go to comprofiler/comprofiler.class.php and around line 1420, replace function unhtmlentities with the one Elesus writes.

3/ at /components/com_comprofiler/comprofiler.php on line 1357 in the addConnection method:

.addslashes(htmlentities($cbCon->getUserMSG())).



change
.addslashes(htmlentities($cbCon->getUserMSG())).

with:
.$cbCon->getUserMSG().

Please Log in to join the conversation.

18 years 4 months ago #1419 by feddyups
OK, although this did the trick for the component, the CB login module continues to render the name of the user wrong.

Have you been using the advanced CB login to help the users of your site register?
have you noted this?:blink:

Please Log in to join the conversation.

18 years 4 months ago #1420 by elesus
I use the CB login module which came up with the RC2. All the settings are in their defaults, so it displays only username.

But as I see it, you need to replace the code near the line 68 in the mod_cbloginrc2.php:

[code:1]if ( $name ) {
$query = "SELECT name FROM #__users WHERE id = ". $my->id;
$database->setQuery( $query );
$name = htmlentities($database->loadResult());
} else {
$name = htmlentities($my->username);
}[/code:1]

with:
[code:1]if ( $name ) {
$query = "SELECT name FROM #__users WHERE id = ". $my->id;
$database->setQuery( $query );
$name = htmlspecialchars($database->loadResult());
} else {
$name = htmlentities($my->username);
}[/code:1]

So it is again about replacing htmlentities with htmlspecialchars

СB3РD

Please Log in to join the conversation.

18 years 4 months ago #1427 by kagux
You might also want to change htmlentities function into htmlspecialchars at line 1250( comprofiler.class.php ) to fix users list.

Please Log in to join the conversation.

18 years 3 months ago #2378 by registoni
I tried to change the code as elesus prescribed but it only worked in back-end and loged-in for editing own profiles. Viewing the Userlist and profiles still incorrect. My charset is russian win-1251 (cp1251). Please help me out.
Faridun

Please Log in to join the conversation.

18 years 3 months ago #2726 by feddyups
www.feddyups.net/Downloads/doc_download.html

I compiled a version of CB with all the necessary modifications.
Let me know if it worked for you.

FYI, remember that all charsets, Database and index.php should be in sync.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.221 seconds

Facebook Twitter LinkedIn