News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

RC1.1 - avatar upload - log errors on file_hash and destName

Started by DannyE, May 24, 2009, 06:18:55 AM

Previous topic - Next topic

DannyE

Avatar upload still produces Undefined variables errors in the logfiles in line 2523:


2521 if (!empty($modSettings['avatar_resize_upload']))
2522 {
2523 $destinationPath = $uploadDir . '/' . ($file_hash === null ? $destName : $cur_profile['id_attach'] . '_' . $file_hash);


Judging by line 2521 this only happens when SMF is configured to resize avatars at upload.

With limited PHP knowledge it is clear to me $file_hash and $destName have not been declared yet prior to line 2523

Only at a later/different elseif branch at line 2568 / 2570 are they declared


2568 $destName = 'avatar_' . $memID . '_' . time() . '.' . $extension;
2569 list ($width, $height) = getimagesize($_FILES['attachment']['tmp_name']);
2570 $file_hash = empty($modSettings['custom_avatar_enabled']) ? getAttachmentFilename($destName, false, null, true) : null;


Should these lines be moved?
Do extra declarations need to be added?


I've checked manually editing
http://custom.simplemachines.org/upgrades/index.php?action=upgrade;file=smf_patch_1.0.17_1.1.9_2.0-RC1-1.zip;smf_version=2.0%20RC1

It also does not add declarations of $file_hash and $destName before the offending line 2523
Or is this done in an include?


poolhall

I'm having a related or the same error after upgrading from Beta 4 to RC 1.1. Avatar upload fails with the "The database value you're trying to insert does not exist: file_hash" error and the errors log reads as follows:

Quotehttp://allboxing.ru/forum/index.php?action=profile;area=forumprofile;save
The database value you're trying to insert does not exist: file_hash
Function: profileSaveAvatarData
File: /var/www/allboxing.ru/forum/Sources/Profile-Modify.php
Строка: 2589

mashby

Is this topic solved or do you require further assistance?
Always be a little kinder than necessary.
- James M. Barrie

Advertisement: