QuestionQ11

Adobe Experience Manager Sites

An Adobe Commerce developer must render a URL in a template.

How should the $url variable be securely output in the template?

  • A <?php echo $escape->escapeUrl($url) ?>
  • B <?php echo $escape->escapeLink($url) ?>
  • C <?php echo $escaper->escapeHtml($url) ?>
Explanation

Adobe Commerce uses context-specific output escaping to prevent XSS. URLs should be processed with escapeUrl, which is the Escaper method intended for URI values, including URLs used in HTML URL attributes.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!