Skip to content

Commit 46ab03f

Browse files
committed
Add SearchTerm to filter listed posts
1 parent 8493a73 commit 46ab03f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/auxiliary/scanner/http/wordpress_content_injection.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ def initialize(info = {})
4343
])
4444

4545
register_advanced_options([
46-
OptInt.new('PostCount', [false, 'Number of posts to list', 100]),
47-
OptBool.new('AutoPublish', [false, 'Publish updated posts', true])
46+
OptInt.new('PostCount', [false, 'Number of posts to list', 100]),
47+
OptString.new('SearchTerm', [false, 'Search term when listing posts']),
48+
OptBool.new('AutoPublish', [false, 'Publish updated posts', true])
4849
])
4950
end
5051

@@ -148,7 +149,8 @@ def list_posts
148149
'uri' => normalize_uri(get_rest_api, 'posts'),
149150
'vars_get' => {
150151
'status' => status,
151-
'per_page' => datastore['PostCount']
152+
'per_page' => datastore['PostCount'],
153+
'search' => datastore['SearchTerm']
152154
}
153155
}, 3.5)
154156

0 commit comments

Comments
 (0)