Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Multibyte string for display name
Avatar
DNB Labs
Rookie
sp_UserOfflineSmall Offline
Nov 12, 2015 - 9:10 am

When trying to add a multibyte string as display name, the result is an empty string written to display_name in the member-table.

This might have something to do with the server setup, but that is not possible to change.

The function sp_filter_save_nocontrolchars() in sp-api-filters.php contains the non-multibyte function substr(). Can you please change it to mb_substr() (if it exists)?

$char = mb_substr($content, $x, 1, SFCHARSET);

Thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 12, 2015 - 9:53 am

As with the other I have opened a ticket for discussion.
Not sure about the need to check for the function to exist though. As far as I am aware it is now a part of the 5 core libraries... I think that happened with 4.0.6, Let me know if you know different please.

andy-signature.png
YELLOW
SWORDFISH
Avatar
DNB Labs
Rookie
sp_UserOfflineSmall Offline
Nov 13, 2015 - 3:43 am

I'm not sure, but the PHP manual says:

"mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option.", http://php.net/manual/en/mbstr.....lation.php

It is also possible to disable the extension, so it's maybe better to be safe than sorry? smile

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 13, 2015 - 4:30 am

So it does... I thought that had changed with php 5

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10118
Posts: 79603