help with special characters in url Profile

I have the following problem: symbol ø

I have a user who was registered with the following name

http://www.notwall.com/brianfløe

this symbol is ø

 

then I have the following error

 

Not Found

The requested URL /brianfløe was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

  • Mariano:
    Hola muchacho/hermano ;)
    Browser hace codifica URL **antes de codigo en php ejecuta
    entonces - php no sabe correcta nombre de usuario.
    PHP piense nombre es  brianfløe 
    y esse es mala. php no sabe  brianfløe
    Necesidad para codificar de nuevo asi que php comprende
    y despues mas posible buscar usuario que tu quere.
    Yo hace codido asi para esta functione antes aqui en mi xampp.
    Si quere ver esse codigo, enviarme mensaje y nosotros discutir detalles mas.
    Yo arreglar codigo antes para TidyPics y problema es mismo alli.
    Ahora problema perdide por que codigo manajer mas bien.
    Principal asuntos es acerca utf8 y url codigo de nombre
    asi que elgg/php sabe donde buscar.  brianfløe 

     

  • I removed your post linking to this topic from an unrelated topic. Please don't do that.

    This works for me on the latest version of Elgg in Chrome. UTF8 and extended character support varies by browser and server, so it's best not to use them in usernames.

  • i'd used seamonkey (on some other tidypics name/url issue) which had utf8, url encoding issues and so lost the real user id.

  • for the moment my solution is: engine/lib/user.php

     

    function create_user_entity($guid, $name, $username, $password, $salt, $email, $language, $code) {
    global $CONFIG;



    $find = array('á','é','í','ó','ú','ñ','Á','É','Í','Ó','Ú','Ñ',' ','ø',',','¿','.');

    $rplc = array('a','e','i','o','u','n','A','E','I','O','U','N','-','o','-','-','-');

     

    $guid = (int)$guid;
    $name = sanitise_string($name);
    $username = sanitise_string($username);
    $username = str_replace($find,$rplc,$username);
    $password = sanitise_string($password);
    $salt = sanitise_string($salt);
    $email = sanitise_string($email);
    $language = sanitise_string($language);
    $code = sanitise_string($code);

    $row = get_entity_as_row($guid);
    if ($row) {
    // Exists and you have access to it
    $query = "SELECT guid from {$CONFIG->dbprefix}users_entity where guid = {$guid}";
    if ($exists = get_data_row($query)) {
    $query = "UPDATE {$CONFIG->dbprefix}users_entity
    SET name='$name', username='$username', password='$password', salt='$salt',
    email='$email', language='$language', code='$code'
    WHERE guid = $guid";

    $result = update_data($query);
    if ($result != false) {
    // Update succeeded, continue
    $entity = get_entity($guid);
    if (elgg_trigger_event('update', $entity->type, $entity)) {
    return $guid;
    } else {
    $entity->delete();
    }
    }
    } else {
    // Exists query failed, attempt an insert.
    $query = "INSERT into {$CONFIG->dbprefix}users_entity
    (guid, name, username, password, salt, email, language, code)
    values ($guid, '$name', '$username', '$password', '$salt', '$email', '$language', '$code')";

    $result = insert_data($query);
    if ($result !== false) {
    $entity = get_entity($guid);
    if (elgg_trigger_event('create', $entity->type, $entity)) {
    return $guid;
    } else {
    $entity->delete();
    }
    }
    }
    }

    return false;
    }

  • amigo:

    codigo para arreglar esse problema es muy poco, poco ;)

    mod/profile/start.php

    function profile_page_handler($page) {
        if (isset($page[0])) {
        //    $username = $page[0];

    $URIx=explode('/',$_SERVER['REQUEST_URI']);      //:DC: START
    $username=urldecode($URIx[3]);      //:DC: END
            $user = get_user_by_username($username);
            elgg_set_page_owner_guid($user->guid);
        }

    y entonces, todos funcione bueno, solo 2 lineas de codigo. 
    disfrutar.. ;-P

     

     

  • works correctly in my xamppl ;-)

    yo prober en mi xampp y funcione
    es bueno para url de perfil.

    prober con usuario llamar  brianfløe
    y ahora elgg encontrar bien y mostrar
    perfil de brianfløe detalles en pantalla.