Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe Exam AD0-E704 Topic 4 Question 42 Discussion

Actual exam question for Adobe's AD0-E704 exam
Question #: 42
Topic #: 4
[All AD0-E704 Questions]

In a phtml, you added script tag and defined couple of js variables as below:Now to protect it from XSS attacks, which two methods allow you to keep the php variable output XSS-safe?Choose 2

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Alison
2 months ago
Escaping URLs? Escaping JavaScript? What is this, a magic show? I'll stick with B and C.
upvoted 0 times
...
Renea
3 months ago
Wait, is this a trick question? I'm going to go with B and C, just to be safe.
upvoted 0 times
...
Kenda
3 months ago
Easy peasy! B and D are the way to go. Gotta love those Magento escape functions!
upvoted 0 times
Glenn
1 months ago
No problem! Always important to protect against XSS attacks.
upvoted 0 times
...
Amie
1 months ago
Good to know! Thanks for the info.
upvoted 0 times
...
Francene
1 months ago
Yes, you're right. $block->escapeJs() and $block->escapeHtmlAttr() are the way to go.
upvoted 0 times
...
Marvel
2 months ago
I think B and D are the correct methods to use for XSS protection.
upvoted 0 times
...
...
Reyes
3 months ago
Hmm, I'm not sure about this one. I'd better double-check the documentation on XSS protection in Magento.
upvoted 0 times
Cary
2 months ago
No, D is not one of the methods for XSS protection in this case.
upvoted 0 times
...
Clement
2 months ago
D) $block->escapeHtmlAttr($myUrl)
upvoted 0 times
...
Rachael
2 months ago
I think A and C are the correct methods to protect against XSS attacks.
upvoted 0 times
...
Melodie
2 months ago
C) $block->escapeHtmlAttr($myName)
upvoted 0 times
...
Vivienne
2 months ago
User1: Let's make sure to always use those methods to keep our code secure.
upvoted 0 times
...
Maryann
2 months ago
A) $block->escapeUrl($myUrl)
upvoted 0 times
...
Bernadine
2 months ago
User2: I agree, those methods should help protect against XSS attacks.
upvoted 0 times
...
Hannah
3 months ago
User1: I think the correct methods are A) $block->escapeUrl($myUrl) and C) $block->escapeHtmlAttr($myName)
upvoted 0 times
...
...
Linwood
3 months ago
I'm not sure about the answer. Can someone explain why D) $block->escapeHtmlAttr($myUrl) is not one of the methods to keep the php variable output XSS-safe?
upvoted 0 times
...
Allene
4 months ago
I agree with Dean. I also think C) $block->escapeHtmlAttr($myName) is another method to protect against XSS attacks.
upvoted 0 times
...
Dean
4 months ago
I think A) $block->escapeUrl($myUrl) is one method to keep the php variable output XSS-safe.
upvoted 0 times
...
Lashaun
4 months ago
I'm not sure about the answer. Can you explain why escapeUrl and escapeHtmlAttr are the right methods to use for protecting against XSS attacks?
upvoted 0 times
...
Pura
4 months ago
I think the correct answers are B and C. Escaping the JavaScript variables is important to prevent XSS attacks.
upvoted 0 times
Edison
3 months ago
Yes, those are the correct methods to keep the php variable output XSS-safe.
upvoted 0 times
...
Glenna
3 months ago
I agree, using escapeJs and escapeHtmlAttr is crucial for protecting against XSS attacks.
upvoted 0 times
...
...
Jamey
4 months ago
I agree with Gracia. Using escapeUrl and escapeHtmlAttr functions will help prevent XSS attacks in the phtml file.
upvoted 0 times
...
Gracia
4 months ago
I think A) $block->escapeUrl($myUrl) and C) $block->escapeHtmlAttr($myName) are the correct methods to keep the php variable output XSS-safe.
upvoted 0 times
...

Save Cancel