Skip to content

Commit eb68801

Browse files
committed
Use filter() instead of attribute selector to avoid selector injection
1 parent d62b441 commit eb68801

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

assets/js/activitypub-moderation-admin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@
346346
_wpnonce: activitypubModerationL10n.nonce
347347
}).done( function() {
348348
// Remove the row from the UI.
349-
$( '.remove-blocklist-subscription-btn[data-url="' + url + '"]' ).closest( 'tr' ).remove();
349+
$( '.remove-blocklist-subscription-btn' ).filter( function() {
350+
return $( this ).data( 'url' ) === url;
351+
}).closest( 'tr' ).remove();
350352

351353
// If no more subscriptions, remove the table.
352354
var table = $( '.activitypub-blocklist-subscriptions table' );

0 commit comments

Comments
 (0)