more work with unicode usernames
This commit is contained in:
parent
0905018d3b
commit
7b56fdebac
@ -82,7 +82,7 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($search) {
|
if($search) {
|
||||||
$sql_extra = " AND groups.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
$sql_extra = " AND groups.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
||||||
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
|
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc(punify($search)) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
|
||||||
|
|
||||||
// This horrible mess is needed because position also returns 0 if nothing is found.
|
// This horrible mess is needed because position also returns 0 if nothing is found.
|
||||||
// Would be MUCH easier if it instead returned a very large value
|
// Would be MUCH easier if it instead returned a very large value
|
||||||
@ -92,7 +92,7 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
$order_extra2 = "CASE WHEN xchan_name LIKE "
|
$order_extra2 = "CASE WHEN xchan_name LIKE "
|
||||||
. protect_sprintf( "'%" . dbesc($search) . "%'" )
|
. protect_sprintf( "'%" . dbesc($search) . "%'" )
|
||||||
. " then POSITION('" . protect_sprintf(dbesc($search))
|
. " then POSITION('" . protect_sprintf(dbesc($search))
|
||||||
. "' IN xchan_name) else position('" . protect_sprintf(dbesc($search)) . "' IN xchan_addr) end, ";
|
. "' IN xchan_name) else position('" . protect_sprintf(dbesc(punify($search))) . "' IN xchan_addr) end, ";
|
||||||
|
|
||||||
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
|
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
|
||||||
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
||||||
@ -435,7 +435,7 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
|
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
|
||||||
if($url) {
|
if($url) {
|
||||||
$query = $url . '?f=' . (($token) ? '&t=' . urlencode($token) : '');
|
$query = $url . '?f=' . (($token) ? '&t=' . urlencode($token) : '');
|
||||||
$query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode($search) : '');
|
$query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode(punify($search)) : '');
|
||||||
|
|
||||||
$x = z_fetch_url($query);
|
$x = z_fetch_url($query);
|
||||||
if($x['success']) {
|
if($x['success']) {
|
||||||
|
@ -14,7 +14,7 @@ class Follow extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$uid = local_channel();
|
$uid = local_channel();
|
||||||
$url = notags(trim(unpunify($_REQUEST['url'])));
|
$url = notags(trim(punify($_REQUEST['url'])));
|
||||||
$return_url = $_SESSION['return_url'];
|
$return_url = $_SESSION['return_url'];
|
||||||
$confirm = intval($_REQUEST['confirm']);
|
$confirm = intval($_REQUEST['confirm']);
|
||||||
$interactive = (($_REQUEST['interactive']) ? intval($_REQUEST['interactive']) : 1);
|
$interactive = (($_REQUEST['interactive']) ? intval($_REQUEST['interactive']) : 1);
|
||||||
|
Reference in New Issue
Block a user