Skip to content

Commit

Permalink
1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Nov 12, 2015
1 parent 4eca53b commit 5ca2a1c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.3.2 #

ENT_SUBSTITUTE added to Alo::unXss()

# 1.3.1 #

Fixed a bug in getUniqid() which tried to use a nonexistent constant
Expand Down
6 changes: 5 additions & 1 deletion docs/class-AloFramework.Common.Alo.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ <h4>See</h4>
<div class="list">
https://secure.php.net/manual/en/function.hash.php<br>
</div>
<h4>Codecoverageignore</h4>
<div class="list">
</div>


</div>
Expand Down Expand Up @@ -744,7 +747,8 @@ <h4>Author</h4>
</div>
<h4>Since</h4>
<div class="list">
1.2<br>
<p>1.3.2 ENT_SUBSTITUTE added<br/>
1.2</p><br>
</div>


Expand Down
5 changes: 3 additions & 2 deletions src/Alo.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,16 @@ static function isTraversable($input) {
*
* @return string|array|Traversable The escaped string. If an array or traversable was passed on, the input
* withall its applicable values escaped.
* @since 1.2
* @since 1.3.2 ENT_SUBSTITUTE added<br/>
* 1.2
*/
static function unXss($input) {
if (self::isTraversable($input)) {
foreach ($input as &$i) {
$i = self::unXss($i);
}
} elseif (is_scalar($input)) {
$input = htmlspecialchars($input, ENT_QUOTES | ENT_HTML5);
$input = htmlspecialchars($input, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE);
}

return $input;
Expand Down

0 comments on commit 5ca2a1c

Please sign in to comment.