mirror of
https://github.com/friendica/friendica
synced 2025-04-26 06:30:11 +00:00
Issue 11487: IDN support added
This commit is contained in:
parent
e374c2e3da
commit
47808ab0e9
4 changed files with 32 additions and 45 deletions
|
@ -38,6 +38,7 @@ use Friendica\Model\Post;
|
|||
use Friendica\Model\Tag;
|
||||
use Friendica\Module\BaseSearch;
|
||||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
class Index extends BaseSearch
|
||||
{
|
||||
|
@ -226,7 +227,8 @@ class Index extends BaseSearch
|
|||
*/
|
||||
private static function tryRedirectToProfile(string $search)
|
||||
{
|
||||
$isUrl = !empty(parse_url($search, PHP_URL_SCHEME));
|
||||
$search = Network::convertToIdn($search);
|
||||
$isUrl = !empty(parse_url($search, PHP_URL_SCHEME));
|
||||
$isAddr = (bool)preg_match('/^@?([a-z0-9.-_]+@[a-z0-9.-_:]+)$/i', trim($search), $matches);
|
||||
|
||||
if (!$isUrl && !$isAddr) {
|
||||
|
@ -274,6 +276,8 @@ class Index extends BaseSearch
|
|||
return;
|
||||
}
|
||||
|
||||
$search = Network::convertToIdn($search);
|
||||
|
||||
if (local_user()) {
|
||||
// Post URL search
|
||||
$item_id = Item::fetchByLink($search, local_user());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue