Skip to content

Commit

Permalink
check if variable isset and not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
hans2103 committed Oct 21, 2020
1 parent 7bdf486 commit c2bf10e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/src/HTML/Helpers/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public static function icon($icon = 'default', $srOnly = '', $attribs = [])
$attribs['aria-hidden'] = 'true';
}

if (isset($srOnly))
if (isset($srOnly) && !empty($srOnly))
{
$text = htmlspecialchars($srOnly, ENT_COMPAT, 'UTF-8');
$text = htmlspecialchars($srOnly, ENT_COMPAT, 'UTF-8');
$srOnly = '<span class="sr-only">' . $text . '</span>';
}

Expand Down

0 comments on commit c2bf10e

Please sign in to comment.