1

(7 replies, posted in PunBB 1.2 troubleshooting)

Thats it, worked like a charm. thank you SO MUCH!!!!

that was the fix.....

2

(7 replies, posted in PunBB 1.2 troubleshooting)

here is the code, BTW thanks alot for looking at it....

// Determine type
            $extensions = null;
            if ($uploaded_file['type'] == 'image/gif')
                $extensions = array('.gif', '.jpg', '.png');
            else if ($uploaded_file['type'] == 'image/jpeg' || $uploaded_file['type'] == 'image/pjpeg')
                $extensions = array('.jpg', '.gif', '.png');
            else
                $extensions = array('.png', '.gif', '.jpg');

            // Move the file to the avatar directory. We do this before checking the width/height to circumvent open_basedir restrictions.
            if (!@move_uploaded_file($uploaded_file['tmp_name'], PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp'))
                return message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');

            // Now check the width/height
LINE 377 ---->>>>>    list($width, $height, $type,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
            if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])
            {
                @unlink(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp');
                return message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
            }
            else if ($type == 1 && $uploaded_file['type'] != 'image/gif')    // Prevent dodgy uploads
           {
                @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
                message($lang_profile['Bad type']);
           }         

            // Delete any old avatars and put the new one in place
            @unlink(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
            @unlink(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.$extensions[1]);
            @unlink(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.$extensions[2]);
            @rename(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp', PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
            @chmod(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.$extensions[0], 0644);
        }
        else
            return message($lang_profile['Unknown failure']);

3

(7 replies, posted in PunBB 1.2 troubleshooting)

why its a punBB thing as well.

4

(7 replies, posted in PunBB 1.2 troubleshooting)

I am using punLA, a variation of punBB.
info:
Punbo version Punbo 0.3
PunBB version PunBB 1.2.8
system: Linux
PHP: 4.4.2 - Show info
Accelerator: N/A Database MySQL 4.0.27-standard
Rows: 1043
Size: 1.36 MB

The img/avatar directory is chmoded to 777

when I try to upload an avatar I hey a php error:
Warning: getimagesize(img/avatars/3.tmp): failed to open stream: No such file or directory in /home/divadevo/public_html/components/com_punbo/board/profile.php on line 377

and then in the info box for the BB I get:
The file you tried to upload is wider and/or higher than the maximum allowed 100x100 pixels

but its 100x99
so its not too big.

Line 377 is here:



LINE 376            // Now check the width/height
LINE 377 ------>>>>>>            list($width, $height, $type,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
            if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])
            {
                @unlink(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp');
                return message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
            }
            else if ($type == 1 && $uploaded_file['type'] != 'image/gif')    // Prevent dodgy uploads
           {
                @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
                message($lang_profile['Bad type']);
           }