Permalink
Browse files

MDL-31171 fix blog attachment serving in BLOG_USER_LEVEL

  • Loading branch information...
1 parent f70f6e9 commit 5274209ac1427a88a992a9d7431697e47d20fdee @skodak skodak committed Jan 15, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/filelib.php
View
@@ -3187,6 +3187,10 @@ function file_pluginfile($relativepath, $forcedownload) {
print_error('siteblogdisable', 'blog');
}
+ $entryid = (int)array_shift($args);
+ if (!$entry = $DB->get_record('post', array('module'=>'blog', 'id'=>$entryid))) {
+ send_file_not_found();
+ }
if ($CFG->bloglevel < BLOG_GLOBAL_LEVEL) {
require_login();
if (isguestuser()) {
@@ -3198,10 +3202,6 @@ function file_pluginfile($relativepath, $forcedownload) {
}
}
}
- $entryid = (int)array_shift($args);
- if (!$entry = $DB->get_record('post', array('module'=>'blog', 'id'=>$entryid))) {
- send_file_not_found();
- }
if ('publishstate' === 'public') {
if ($CFG->forcelogin) {

0 comments on commit 5274209

Please sign in to comment.