|
9 | 9 | * @package unmus |
10 | 10 | * @since 0.9 |
11 | 11 | * |
12 | | - * @link https://epiph.yt/en/blog/2025/activitypub-plugin-and-accidental-ddos/ |
| 12 | + * @link https://epiph.yt/blog/2025/das-activitypub-plugin-und-der-versehentliche-ddos/ |
13 | 13 | */ |
14 | 14 |
|
15 | 15 | // Security: Stops code execution if WordPress is not loaded |
@@ -111,7 +111,8 @@ function unmus_is_activitypub_endpoint( string $uri ) :bool { |
111 | 111 | function unmus_cache_determine_object_type( $object_type, $cache_key, $data, $uri ) { |
112 | 112 |
|
113 | 113 | if (unmus_is_activitypub_endpoint( $uri ) ) { |
114 | | - $object_type = 'ActivityPub'; |
| 114 | + return 'ActivityPub'; |
| 115 | + } else { |
115 | 116 | return $object_type; |
116 | 117 | } |
117 | 118 | } |
@@ -153,13 +154,14 @@ function unmus_cache_reset_by_transition_post_status( string $new_status, string |
153 | 154 | * Always return false for ActivityPub endpoints, |
154 | 155 | * since cache entries cannot be flushed otherwise. |
155 | 156 | * |
156 | | - * @param bool $is_single Whether the current cache represents a single item |
157 | | - * @param mixed $data Data to cache |
158 | | - * @param string $uri Request URI |
159 | | - * @return bool Whether the cache represents a single item |
| 157 | + * @param bool $is_single Whether the current cache represents a single item |
| 158 | + * @param mixed $data Data to cache |
| 159 | + * @param string $uri Request URI |
| 160 | + * @return bool Whether the cache represents a single item |
160 | 161 | */ |
161 | 162 |
|
162 | 163 | function set_is_single_item( bool $is_single, mixed $data, string $uri ): bool { |
| 164 | + |
163 | 165 | if ( unmus_is_activitypub_endpoint( $uri ) ) { |
164 | 166 | return false; |
165 | 167 | } |
|
0 commit comments