Skip to content

Commit

Permalink
tag string clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainbow-Spike committed Jun 17, 2022
1 parent 43e7b58 commit 75bf6d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions syntax/tag.php
Expand Up @@ -46,7 +46,9 @@ 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 = preg_replace(array('/[[: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

if (!$tags) return false;

Expand Down

0 comments on commit 75bf6d0

Please sign in to comment.