diff --git a/composer.json b/composer.json index 6f6a2a5..b6cac76 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/src/PostData.php b/src/PostData.php index 02239d6..2c4d0d7 100644 --- a/src/PostData.php +++ b/src/PostData.php @@ -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 ''; } diff --git a/tests/src/PostDataTest.php b/tests/src/PostDataTest.php index a641b3f..fdb9cb6 100644 --- a/tests/src/PostDataTest.php +++ b/tests/src/PostDataTest.php @@ -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, ]); @@ -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, ]);