Added a fix to help user profile pictures under safe mode (from Mahmoud H. Hasan)

PHP manual mentions it too.
This commit is contained in:
moodler
2006-01-28 14:15:56 +00:00
parent 0600f5be99
commit fe9f19ef1e
+2
View File
@@ -183,6 +183,8 @@ function save_profile_image($id, $uploadmanager, $dir='users') {
ImageCopyBicubic($im2, $im, 0, 0, $cx-$half, $cy-$half, 35, 35, $half*2, $half*2);
if (function_exists('ImageJpeg')) {
@touch($CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg'); // Helps in Safe mode
@touch($CFG->dataroot .'/'. $dir .'/'. $id .'/f2.jpg'); // Helps in Safe mode
if (ImageJpeg($im1, $CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg', 90) and
ImageJpeg($im2, $CFG->dataroot .'/'. $dir .'/'. $id .'/f2.jpg', 95) ) {
@chmod($CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg', 0666);