minor tweak to utf8 usernames after some testing of the underlying encode/decode funations. This probably isn't critical and I do not have a failure case but just trying to cover all bases.
This commit is contained in:
parent
59ac3d04eb
commit
b688dc3995
@ -2240,6 +2240,11 @@ function get_zcard_embed($channel, $observer_hash = '', $args = array()) {
|
|||||||
* - false if no channel with $nick was found
|
* - false if no channel with $nick was found
|
||||||
*/
|
*/
|
||||||
function channelx_by_nick($nick) {
|
function channelx_by_nick($nick) {
|
||||||
|
|
||||||
|
// If we are provided a Unicode nickname convert to IDN
|
||||||
|
|
||||||
|
$nick = punify($nick);
|
||||||
|
|
||||||
$r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_address = '%s' and channel_removed = 0 LIMIT 1",
|
$r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_address = '%s' and channel_removed = 0 LIMIT 1",
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
|
@ -3344,6 +3344,9 @@ function featured_sort($a,$b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Be aware that punify will convert domain names and pathnames
|
||||||
|
|
||||||
|
|
||||||
function punify($s) {
|
function punify($s) {
|
||||||
require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
|
require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
|
||||||
$x = new idna_convert(['encoding' => 'utf8']);
|
$x = new idna_convert(['encoding' => 'utf8']);
|
||||||
@ -3351,6 +3354,8 @@ function punify($s) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Be aware that unpunify will only convert domain names and not pathnames
|
||||||
|
|
||||||
function unpunify($s) {
|
function unpunify($s) {
|
||||||
require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
|
require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
|
||||||
$x = new idna_convert(['encoding' => 'utf8']);
|
$x = new idna_convert(['encoding' => 'utf8']);
|
||||||
|
Reference in New Issue
Block a user