| @@ -138,12 +138,9 @@ | ||
| 138 | 138 | if (($post->post_type ?? '') !== ObjectHandler::ATTACHMENT_OBJECT_TYPE) { |
| 139 | 139 | return null; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - // Unfiltered, because the plugin denies the path through the get_attached_file filter for | |
| 143 | - // users without access. Filtered it would hide the file from the access check below, which | |
| 144 | - // then could not answer the request with the no rights page any more. | |
| 145 | - $attachedFile = $this->wordpress->getAttachedFile($post->ID, true); | |
| 142 | + $attachedFile = $this->wordpress->getAttachedFile($post->ID); | |
| 146 | 143 | |
| 147 | 144 | if ($attachedFile === false |
| 148 | 145 | || $this->isInsideUploadDirectory($attachedFile, $uploadDirs['basedir']) === false |
| 149 | 146 | ) { |
| @@ -281,12 +278,12 @@ | ||
| 281 | 278 | { |
| 282 | 279 | $postableTypes = implode('\',\'', $this->objectHandler->getPostTypes()); |
| 283 | 280 | |
| 284 | 281 | $query = $this->database->prepare( |
| 285 | - "SELECT `ID` | |
| 286 | - FROM `{$this->database->getPostsTable()}` | |
| 287 | - WHERE `post_name` = %s | |
| 288 | - AND `post_type` IN ('$postableTypes')", | |
| 282 | + "SELECT ID | |
| 283 | + FROM {$this->database->getPostsTable()} | |
| 284 | + WHERE post_name = %s | |
| 285 | + AND post_type IN ('$postableTypes')", | |
| 289 | 286 | $name |
| 290 | 287 | ); |
| 291 | 288 | |
| 292 | 289 | return (int) $this->database->getVariable($query); |