SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Avatar - I will upload my own picture:...Error Log

Started by sparkylinked, October 19, 2007, 09:01:02 PM

Previous topic - Next topic


Hi, I have been having an on going problem with uploading Avatars. Using the built in avatars, and linking to an avatar works perfect, but when users try to upload their own avatar nothing happens. The person gets no error and it looks as though it worked, but no avatar shows up at all.

I checked the forum error log and got this message:


8: Undefined variable: clean_name
File: /home/content/J/a/s/JasonLinked/html/forum/Sources/Subs.php
Line: 3458

This is my Subs.php file starting from line 3458:

   // Sorry, no spaces, dots, or anything else but letters allowed.
   $clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name);

   $enc_name = $attachment_id . '_' . strtr($clean_name, '.', '_') . md5($clean_name);
   $clean_name = preg_replace('~\.[\.]+~', '.', $clean_name);

   if ($attachment_id == false || ($new && empty($modSettings['attachmentEncryptFilenames'])))
      return $clean_name;
   elseif ($new)
      return $enc_name;

   if (file_exists($modSettings['attachmentUploadDir'] . '/' . $enc_name))
      $filename = $modSettings['attachmentUploadDir'] . '/' . $enc_name;
      $filename = $modSettings['attachmentUploadDir'] . '/' . $clean_name;

   return $filename;

Note: I run Japanese OS and all backslashes are YEN symbols. This is true for the code above.

I have no idea how to repair this. Could someone please advise me on how to fix this problem it has persisted way too long.

Thank you in Advance



This has been consistant versions since 1.1 ...1.1.4 is now installed.

I have these mods installed:

SMF 1.1.1 Update Package     1.1.1     [ Uninstall ]
2.    Ad Managment    2.0    [ Uninstall ]
3.    Language Drop    1.1    [ Uninstall ]
4.    Country Flags    1.0.1    [ Uninstall ]
5.    SMF 1.1.2 Update Package    1.1.2    [ Uninstall ]
6.    FlashChat Integration    0.1 Beta    [ Uninstall ]
7.    Gallery 2 Integration    1.0beta3    [ Uninstall ]
8.    SMF Quick Theme Changer    1.0.0    [ Uninstall ]
9.    SMF 1.0.11 / 1.1.3 Update    1.1    [ Uninstall ]
10.    SMF 1.0.12 / 1.1.4 / 2.0 b1.1 Update    1.0

I am currently using the default theme but Leviathan by Bloc is also installed, as well as Dilber Mc


Have you tried to remove the few mods you have installed?
It maybe possible one of them is generating this error.

Which line is that exactly? Nothing there looks like it should be returning emtpy or unset so that is quiet odd.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ ~ Support the SMF Support team!


the first line is giving the error

$clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name);

I guess I will have to try uninstalling mods *sigh*


Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert