Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
61a78951
...
61a7895187c6fe2c2b82659818a0b0fc067cdade
authored
2024-08-07 10:53:58 +0800
by
赵聪
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
过滤特殊字符
1 parent
ceaef89b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletions
app/Http/Controllers/Release/BaseController.php
app/Http/Controllers/Release/BaseController.php
View file @
61a7895
...
...
@@ -174,11 +174,14 @@ class BaseController extends Controller
}
}
//针对外显-特殊处理
//
1.
针对外显-特殊处理
if
(
strpos
(
$params
,
'brandShowName[]'
)
!==
false
)
{
$params
=
str_replace
(
'brandShowName[]'
,
'brandShowName{}'
,
$params
);
}
//2.去除特殊字符
$params
=
$this
->
removeSpecialCharacter
(
$params
);
file_put_contents
(
'1.log'
,
$params
.
"
\r\n\r\n
"
,
FILE_APPEND
);
Log
::
channel
(
'api'
)
->
info
(
__METHOD__
.
':签名参数'
,
[
...
...
@@ -192,6 +195,17 @@ class BaseController extends Controller
}
/**
* 去除特殊字符
* @param string $params
* @return string
*/
private
function
removeSpecialCharacter
(
string
$params
)
:
string
{
$character
=
[
'\u005C'
,
'\u00A0'
,
'\u2028'
,
'\u2029'
,
'\uFEFF'
,
'\u0008'
,
'\u0009'
,
'\u000A'
,
'\u000B'
,
'\u000C'
,
'\u000D'
,
'\u0022'
,
'\u0027'
];
return
str_replace
(
$character
,
''
,
$params
);
}
/**
* 签名需要,递归处理子数组中Int型数字转换成字符串
* @param array $array
* @return array
...
...
Please
register
or
sign in
to post a comment