$this->uri->segment(4, \'\')竟然没有解码还原

index.php/test/admin/del/1^2

$this->uri->segment(4, '') == '1%5E2'

很无语

轻量级的东西就是过于啥了;

好像没见那里有设置要自动转码,

但是我认为,没有谁想使用转码后的字符吧?

谁会想输入一个^,然后拿%5e来用?

如果是gb2312编码时,里面有了中文情况会更加复杂,还需要urldecode后再utf8转gb2312才能正常使用,把这个过程免了,就会增加很多没必要的麻烦了.

只能说轻量得无语了;

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
public function handle(array $arrParam = []) { $arrDeveloper = $this->getDeveloper($this->intAdvChannel); $strClientId = $arrDeveloper['client_id']; $strClientSecret = $arrDeveloper['client_secret']; $strCode = $arrParam['authorization_code'] ?? ''; $intAdvertiserRole = $arrParam['state'] ?? 2; $arrRequestData = [ 'client_id' => $strClientId, 'client_secret' => $strClientSecret, 'grant_type' => 'authorization_code', 'authorization_code' => $strCode, 'redirect_uri' => sprintf($this->getAuthCallbackUri(), Enum::GDT), //传入的地址需要与获取 authorization_code 时,传入的回调地址保持一致 ]; $arrOption = [ RequestOptions::QUERY => $arrRequestData, 'method' => 'GET', ]; $arrSelfResponse = Utils::doRequest($this->strAccessTokenUrl, $arrOption); if ($arrSelfResponse['code'] != 200) { return $this->errorArr($arrSelfResponse['code'], $arrSelfResponse['msg']); } $arrResponse = $arrSelfResponse['data'] ?? []; if (!isset($arrResponse['code']) || $arrResponse['code'] != 0) { Log::get($this->strChannelName)->error($this->strChannelName . "-获取access_token失败", [ 'url' => $this->strAccessTokenUrl, 'request' => $arrRequestData, 'response' => $arrResponse ]); return $this->errorArr(ErrorCode::OAUTH_GET_ACCESS_TOKEN_FAIL, $arrResponse['message']); } $arrAccessToken = $arrResponse['data']; $result = $this->setOAuthToken($arrAccessToken, $intAdvertiserRole, $arrParam['auth_request_id']); if ($result) { return $this->successArr(); } return $this->errorArr(); }在goframe框架中实现以上代码
最新发布
05-28

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值