Cakephp3奇怪的行为与外部链接在url参数中有https(第一个https获取删除)

时间:2017-12-06 20:33:13

标签: url cakephp https parameters cakephp-3.0

好的我正在尝试使用LinkedIn的api,当我构建一个示例调用时,请在下面举例

<a href="https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=123456789&redirect_uri=https://www.example.com/auth/linkedin&state=987654321">Login</a>

在cakephp 3的前端显示如下,第一个https被条带化了

<a href="/oauth/v2/authorization?response_type=code&amp;client_id=123456789&redirect_uri=https://www.example.com/auth/linkedin&state=wGg4ksv8WHpx26dV">Login in</a>

我从redirct_uir参数或当前显示的整个https参数中删除redirct_uri。任何人都知道如何解决这个或一个好的工作。我需要在两个网址中都有一个https才能使api正常工作。

1 个答案:

答案 0 :(得分:2)

您在查询参数中使用了无效字符。我猜测浏览器正在剥离https,因为://查询标识符后面有?个字符。

您必须致电urlencode("https://www.example.com/auth/linkedin")并将结果用作查询参数。