Skip to content

Commit

Permalink
replace trim() by str_replace for cleaning U+200b (zero width space)
Browse files Browse the repository at this point in the history
Fixes #250
  • Loading branch information
Klap-in committed Aug 25, 2023
1 parent ef93eb2 commit 5871336
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function connectTo($mode)
function handle($match, $state, $pos, Doku_Handler $handler)
{
$tags = trim(substr($match, 6, -2)); // strip markup & whitespace
$tags = trim($tags, "\xe2\x80\x8b"); // strip word/wordpad breaklines
$tags = str_replace("\xe2\x80\x8b", '', $tags); // strip word/wordpad breaklines(U+200b)
$tags = preg_replace(['/[[:blank:]]+/', '/\s+/'], " ", $tags); // replace linebreaks and multiple spaces with one space character
$tags = preg_replace('/[\x00-\x1F\x7F]/u', '', $tags); // strip unprintable ascii code out of utf-8 coded string

Expand Down

0 comments on commit 5871336

Please sign in to comment.