Skip to content

Commit

Permalink
[Fix] Encode uri for use in blink key (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnwjn authored Oct 10, 2023
1 parent b4bad3f commit 00ff411
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Entries/EntryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function find($id): ?EntryContract

public function findByUri(string $uri, string $site = null): ?EntryContract
{
$blinkKey = "eloquent-entry-{$uri}".($site ? '-'.$site : '');
$blinkKey = 'eloquent-entry-'.md5(urlencode($uri)).($site ? '-'.$site : '');
$item = Blink::once($blinkKey, function () use ($uri, $site) {
return parent::findByUri($uri, $site);
});
Expand Down
2 changes: 1 addition & 1 deletion src/Taxonomies/TermRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function findByUri(string $uri, string $site = null): ?TermContract
return null;
}

$blinkKey = "eloquent-term-{$uri}".($site ? '-'.$site : '');
$blinkKey = 'eloquent-term-'.md5(urlencode($uri)).($site ? '-'.$site : '');
$term = Blink::once($blinkKey, function () use ($slug, $taxonomy) {
return $this->query()
->where('slug', $slug)
Expand Down

0 comments on commit 00ff411

Please sign in to comment.