#56339 closed defect (bug) (fixed)
Issue with plugin install pagination
Reported by: | praful2111 | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | has-patch has-screenshots |
Focuses: | javascript, administration | Cc: |
Description
When users search for any plugin with any special character(&) and click on pagination page 2 the URL will consider new parameters after the &.
Here is the video link - https://www.awesomescreenshot.com/video/10352796?key=68a9c344d22c2b84328dcfd7da152c19
Attachments (4)
Change History (20)
#1
@
2 years ago
Hello, thank you for the ticket and patch!
Moving for 6.1 consideration.
Maybe event.target.value
should be sanitized before/outside of the value assignment?
#4
@
2 years ago
@audrasjb No directly passing the value under the funcation, Not sanitized before/outside of the funcation.
#5
@
2 years ago
- Keywords changes-requested added
I can verify that the issue exists and that the patch fixes one instance of &
.
To deal with all instances of &
, for example, search & replace & search again
the replace()
call should be changed to:
event.target.value.replace( /&/g, '%26' )
#6
@
2 years ago
I'm not a specialist, but maybe it's better to use something like encodeURIComponent
?
#7
@
2 years ago
Tested with:
const uri = 'test&test'; const encoded = encodeURIComponent(uri); console.log(uri); console.log(encoded); > "test&test" > "test%26test"
#8
@
2 years ago
Good call @audrasjb, that seems to work just fine with multiple &
and with various additional characters.
#10
@
2 years ago
- Keywords has-screenshots added
- Owner set to audrasjb
- Status changed from new to reviewing
This ticket was mentioned in PR #3068 on WordPress/wordpress-develop by audrasjb.
2 years ago
#11
Trac ticket: https://core.trac.wordpress.org/ticket/56339
#12
@
2 years ago
I added a PR to fix a small Coding standards issue in the previous patch, add also to add a missing occurence.
@costdev @praful2111 looks good to you?
2 years ago
#16
Committed in https://core.trac.wordpress.org/changeset/53844
I have updated admin side plugin js