Skip to content

Commit

Permalink
fix: apostrophes breaking alfred()
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jul 21, 2023
1 parent e92f9bc commit 3bcc291
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions RockFrontend.module.php
Expand Up @@ -512,6 +512,11 @@ public function alfred($page = null, $options = [])
'type' => $opt->type,
]);

// entity encode alfred string
// this is to avoid "invalid json" errors when using labels with apostrophes
// like "Don't miss any updates"
$str = $this->wire->sanitizer->entities1($str);

// save markup to cache and generate alfred tag
// the tag will be replaced on page render
// this is to make it possible to use alfred() without |noescape filter)
Expand Down

0 comments on commit 3bcc291

Please sign in to comment.