Skip to content

Commit

Permalink
Merge pull request #10 from travisulrich/patch-3
Browse files Browse the repository at this point in the history
Escape HTML output before adding <br> tags
  • Loading branch information
adamlc committed Mar 7, 2015
2 parents 143d218 + 4cda187 commit 130d827
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Adamlc/AddressFormat/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public function formatAddress($html = false)

//Replace new lines!
if ($html) {
$formatted_address = htmlentities($formatted_address, ENT_QUOTES, 'UTF-8', false);
$formatted_address = str_replace('%n', "\n" . '<br>', $formatted_address);
} else {
$formatted_address = trim(str_replace('%n', "\n", $formatted_address));
Expand Down

0 comments on commit 130d827

Please sign in to comment.