Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
},
"platform": {
"php": "8.2"
},
"audit": {
"ignore": {
"PKSA-mdq4-51ck-6kdq": "CRLF injection in default email rule (CVE-2026-48019); no fix for EOL Laravel 10, which this package requires until the Acorn 5 upgrade.",
"PKSA-3r5d-mb8f-1qw9": "Duplicate of CVE-2026-48019 via the FriendsOfPHP advisory database.",
"PKSA-m5cs-t1y6-qpcs": "Temporary signed URL path confusion; no fix for EOL Laravel 10, which this package requires until the Acorn 5 upgrade."
}
}
},
"support": {
Expand Down
2 changes: 1 addition & 1 deletion src/PostData.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function hasThumbnail(): bool

public function url(): string
{
if (null === $this->id || ! is_post_publicly_viewable($this->id)) {
if (null === $this->id || ! is_post_type_viewable($this->postType)) {
return '';
}

Expand Down
14 changes: 7 additions & 7 deletions tests/src/PostDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
'return' => 'https://example.com/hello-world',
]);

\WP_Mock::userFunction('is_post_publicly_viewable', [
'args' => [1],
\WP_Mock::userFunction('is_post_type_viewable', [
'args' => ['post'],
'return' => true,
]);

expect($this->postData->url())->toBe('https://example.com/hello-world');
});

it('returns an empty string when post is not publicly viewable', function () {
\WP_Mock::userFunction('is_post_publicly_viewable', [
'args' => [1],
it('returns an empty string when post type is not viewable', function () {
\WP_Mock::userFunction('is_post_type_viewable', [
'args' => ['post'],
'return' => false,
]);

Expand All @@ -52,8 +52,8 @@
'return' => false,
]);

\WP_Mock::userFunction('is_post_publicly_viewable', [
'args' => [1],
\WP_Mock::userFunction('is_post_type_viewable', [
'args' => ['post'],
'return' => true,
]);

Expand Down
Loading