Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special Characters in Summoner Name not working #51

Open
StreakyCat opened this issue Sep 29, 2015 · 0 comments
Open

Special Characters in Summoner Name not working #51

StreakyCat opened this issue Sep 29, 2015 · 0 comments

Comments

@StreakyCat
Copy link

Using the getSummonerId with summoner names that contain special characters (á,é,î,ô,ý...)
results in NOT FOUND. A fix would be:

$query = "Summoner name with special chars á,é,î,ô,ý" ;
$query = utf8_decode($query) ;

Now you can safely pass your $query to getSummonerId($query):

function getSummonerId($query)
{
    global $api;

    try 
    {
        $r = $api->getSummonerId($sum_name);
        return json2array($r);
    } 
    catch(Exception $e) 
    {
        echo "Error: " . $e->getMessage();
        return null;
    };
}

Inside your php-riot-api.php you have to modify $call inside function getSummonerByName($name):

public function getSummonerByName($name)
{   
    //OLD $call = 'summoner/by-name/' .  rawurlencode($name);
    $call = 'summoner/by-name/' . rawurlencode(utf8_encode($name));

    //add API URL to the call
    $call = self::API_URL_1_4 . $call;

    return $this->request($call);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant