| Next revision | Previous revision |
| scriptlog:lib:service:protectedpostservice [2026/09/26 09:09] – admin admin | scriptlog:lib:service:protectedpostservice [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@category'' | Service | | | ''@category'' | Service | |
| | ''@author'' | Scriptlog Team | | | ''@author'' | Scriptlog Team | |
| | ''@license'' | MIT | | | ''@license'' | MIT | |
| | ''@version'' | 1.0 | | | ''@version'' | 1.0 | |
| | ''@since'' | Since Release 1.0 | | | ''@since'' | Since Release 1.0 | |
| |
| ======= Inheritance ======= | ======= Inheritance ======= |
| //None.// | //None.// |
| |
| ======= Properties (0) ======= | ======= Properties (1) ======= |
| |
| //None declared.// | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | | ''private'' | ''(untyped)'' | ''$decryptPost'' | | 34 | |
| |
| ======= Methods (3) ======= | ======= Methods (3) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''__construct()'' | Constructor. | 43 | | | public | ''__construct()'' | Constructor. | 43 | |
| | public | ''resolve()'' | Resolve the content branch and unlocked state for a post row. | 61 | | | public | ''resolve()'' | Resolve the content branch and unlocked state for a post row. | 61 | |
| | public | ''sanitizeContent()'' | Sanitize post content for safe output. | 107 | | | public | ''sanitizeContent()'' | Sanitize post content for safe output. | 107 | |
| |
| |
| Constructor. | Constructor. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$decryptPost'' | ''?callable'' | ''null'' | Callable (int $id, string $password) => array defaulting to the global decrypt_post() helper when available. | | | ''$decryptPost'' | ''?callable'' | ''null'' | Callable (int $id, string $password) => array defaulting to the global decrypt_post() helper when available. | |
| |
| |
| HTML content for the public/unlocked branches. | HTML content for the public/unlocked branches. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$post'' | ''array'' | //required// | The raw post row (requires ID, post_visibility, and post_content keys). | | | ''$post'' | ''array'' | //required// | The raw post row (requires ID, post_visibility, and post_content keys). | |
| | ''$unlockedPosts'' | ''array'' | ''[]'' | Session store mapping post ID => password. | | | ''$unlockedPosts'' | ''array'' | ''[]'' | Session store mapping post ID => password. | |
| |
| **Returns:** ''(none declared)'' — array{id:int,is_protected:bool,is_unlocked:bool,show_password_form:bool,content:string} | **Returns:** ''(none declared)'' — array{id:int,is_protected:bool,is_unlocked:bool,show_password_form:bool,content:string} |
| blacklist. Preserves the exact pipeline previously inline in single.php. | blacklist. Preserves the exact pipeline previously inline in single.php. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$content'' | ''string'' | //required// | Raw, unsanitized post content. | | | ''$content'' | ''string'' | //required// | Raw, unsanitized post content. | |
| |
| **Returns:** ''string'' — string Sanitized HTML safe to echo into the template. | **Returns:** ''string'' — string Sanitized HTML safe to echo into the template. |