MDL-31171 fix blog attachment serving in BLOG_USER_LEVEL

This commit is contained in:
Petr Skoda
2012-01-19 18:35:37 +01:00
committed by kordan
parent 6dd4f20261
commit 90876da7fa
+4 -4
View File
@@ -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) {