Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
56a04886
Commit
56a04886
authored
7 years ago
by
卜木
Committed by
花裤衩
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
prevent JSON.parse fault when search is undefined
parent
ffd668fb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/index.js
+5
-1
5 additions, 1 deletion
src/utils/index.js
with
5 additions
and
1 deletion
src/utils/index.js
+
5
−
1
View file @
56a04886
...
...
@@ -110,7 +110,11 @@
export
function
param2Obj
(
url
)
{
const
search
=
url
.
split
(
'
?
'
)[
1
];
return
JSON
.
parse
(
'
{"
'
+
decodeURIComponent
(
search
).
replace
(
/"/g
,
'
\\
"
'
).
replace
(
/&/g
,
'
","
'
).
replace
(
/=/g
,
'
":"
'
)
+
'
"}
'
)
if
(
search
!==
undefined
)
{
return
JSON
.
parse
(
'
{"
'
+
decodeURIComponent
(
search
).
replace
(
/"/g
,
'
\\
"
'
).
replace
(
/&/g
,
'
","
'
).
replace
(
/=/g
,
'
":"
'
)
+
'
"}
'
);
}
return
{};
}
export
function
html2Text
(
val
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment