简体   繁体   English

Yii redirect()转换为&到&-HybridAuth Google

[英]Yii redirect() converted & to & - HybridAuth Google

I'm using HybridAuth 2.1.2 for social logins on my website, realized with Yii Framework. 我正在使用HybridAuth 2.1.2在我的网站上进行社交登录,这是通过Yii Framework实现的。

Facebook works without problems. Facebook可以正常工作。 I got problems with the other logins like Google. 我在使用Google等其他登录名时遇到了问题。

HybridAuth redirects the user to the following URL: HybridAuth将用户重定向到以下URL:

https://accounts.google.com/o/oauth2/auth?client_id=XXXCLIENTIDXXX&redirect_uri=http%3A%2F%2Fwww.XXX.de%2Fsociallogin%3Fhauth.done%3DGoogle&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=online

If I echo the redirect url in HybridAuth/hybridauth-2.1.2/Hybrid/Providers/Google.php I get this url: 如果我在HybridAuth / hybridauth-2.1.2 / Hybrid / Providers / Google.php中回显重定向网址,则会得到以下网址:

https://accounts.google.com/o/oauth2/auth?client_id=XXXCLIENTXXX&redirect_uri=http%3A%2F%2Fwww.XXX.de%2Fsociallogin%3Fhauth.done%3DGoogle&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=online

Google.php: Google.php:

[...]
    echo $this->api->authorizeUrl( $parameters );
    return true;
    Hybrid_Auth::redirect( $this->api->authorizeUrl( $parameters ) ); 
}

The problem is the &-sign I think. 问题是我认为的符号。 Any ideas how to suppress redirect() to generate encrypted URLs? 任何想法如何抑制redirect()生成加密的URL?

在.htaccess文件中添加以下行可解决此问题:

php_value  arg_separator.output  &

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM