Permalink
Browse files

Merge branch 's11_MDL-27866_pix_url_master' of git://github.com/dongs…

…heng/moodle
  • Loading branch information...
2 parents 256383c + 4be8a7d commit e2542e1faff9bd2708d6864c05942a9e923be081 Sam Hemelryk committed Jun 28, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 pluginfile.php
View
@@ -294,6 +294,9 @@
// ========================================================================================================================
} else if ($component === 'user') {
if ($filearea === 'icon' and $context->contextlevel == CONTEXT_USER) {
+ // XXX: pix_url will initialize $PAGE, so we have to set up context here
+ // this temp hack should be fixed by better solution
+ $PAGE->set_context(get_system_context());
if (!empty($CFG->forcelogin) and !isloggedin()) {
// protect images if login required and not logged in;
// do not use require_login() because it is expensive and not suitable here anyway

0 comments on commit e2542e1

Please sign in to comment.