-
Notifications
You must be signed in to change notification settings - Fork 61
Fixes #99 - Missing documentation for Escape view helpers #189
Fixes #99 - Missing documentation for Escape view helpers #189
Conversation
public $headline = '<h1>Foo</h1>'; | ||
}; | ||
|
||
var_dump($this->escapeHtml($object, Zend\View\Helper\EscapeHtml::RECURSE_OBJECT)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the 2nd param required here?
I assume the same result we get without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the second parameter an exception is thrown:
zend-view/src/Helper/Escaper/AbstractHelper.php
Lines 72 to 74 in b486187
throw new Exception\InvalidArgumentException( | |
'Object provided to Escape helper, but flags do not allow recursion' | |
); |
doc/book/helpers/escape.md
Outdated
|
||
The following helpers can **escape output in view scripts and defend from XSS | ||
and related vulnerabilities**. To escape different contexts of a HTML document, | ||
zend-view provides 5 helpers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like fixed numbers, it's a very big chance that it will be not update if the number of escapers change.
Maybe better "provides the following helpers:" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good point! 👍
Fixes #99 - Missing documentation for Escape view helpers
Thanks, @froschdesign! |
No description provided.