PluginProbe
User Access Manager / 2.3.18
User Access Manager v2.3.18
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/Controller/Frontend/RedirectController.php +5 -8 trunk2.3.18 View file →
@@ -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);