Skip to content

Commit

Permalink
Ganze HTML-Tags schützen, statt nur Attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebusryan committed Jul 22, 2016
1 parent ab083a3 commit 2b307b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/class.hyphenator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class hyphenator {
private static $hyphenators = array();

public static function hyphenate($string, $language = '') {
//Start - save html-attributes
preg_match_all('/(\S+)=["\']((?:.(?!["\']?\s+(?:\S+)=|[>"\']))+.)["\']/', $string, $matches, PREG_SET_ORDER);
//Start - save html-tags
preg_match_all('/<[^<]*>/', $string, $matches, PREG_SET_ORDER);
foreach ($matches as $index => $match) {
$match[0] = str_replace(['?'], ['\?'], $match[0]);
$string = preg_replace('|'.$match[0].'|', '###'.$index.'###', $string, 1);
Expand Down

0 comments on commit 2b307b0

Please sign in to comment.