aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/icon.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profile/icon.php')
-rw-r--r--mod/profile/icon.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/mod/profile/icon.php b/mod/profile/icon.php
index dd87ff939..c201d7716 100644
--- a/mod/profile/icon.php
+++ b/mod/profile/icon.php
@@ -26,9 +26,17 @@
// Try and get the icon
$filehandler = new ElggFile();
- $filehandler->setFilename($username . $size . ".jpg");
- if ($filehandler->open("read") && $contents = $filehandler->read($filehandler->size())) {
- } else {
+ $filehandler->owner_guid = $user->getGUID();
+ $filehandler->setFilename("profile/" . $username . $size . ".jpg");
+
+ $success = false;
+ if ($filehandler->open("read")) {
+ if ($contents = $filehandler->read($filehandler->size())) {
+ $success = true;
+ }
+ }
+
+ if (!$success) {
global $CONFIG;
$contents = @file_get_contents($CONFIG->pluginspath . "profile/graphics/default{$size}.jpg");