View Single Post
  #1  
Old 23rd October 2008, 06:05
dezza's Avatar
dezza dezza is offline
Senior Member
 
Join Date: Oct 2008
Posts: 53
Default takeprofedit.php [Line 76-87] Too big error ..
I got the newest RC2.1 source from this site in the sticky ..

I was fixing several bugs and I came across one that pushed my head against a wall here in the early morning..:shoot:

It's line "76-84" if you have the unmodified version of takeprofedit.php.

No matter what, it always says that the avatar is too big when you put in an URL ..

And this is not true, the limit was 200x200, and the avatar link I put in was 150x170! (http://dezza.dk/dezza_avatar.png)

PHP Code:
// Check remote avatar size
    
if ($avatar) {
                
$size getimagesize($avatar);
                
$width $size[0];
                
$height $size[1];
            if (
$width $aw || $height $ah# WHY DOESN'T THIS TRIGGER?
                    
echo "?? WTF ?? NO TRIGGER HERE??";
            if (!
preg_match('#^((http)|(ftp):\/\/[a-zA-Z0-9\-]+?\.([a-zA-Z0-9\-]+\.)+[a-zA-Z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is'$avatar))
                    
newerr($tracker_lang['error'], $tracker_lang['avatar_adress_invalid']);
            if (!(list(
$width$height) = $avatar))
                    
newerr($tracker_lang['error'], $tracker_lang['avatar_adress_invalid']);
            if (
$width $aw || $height $ah# THIS ONE TRIGGERS!!!
                    
newerr($tracker_lang['error'], sprintf($tracker_lang['avatar_is_too_big'], $aw$ah));
    } 
Try inserting the same piece of code into your code!

Insert after line 77 ..
PHP Code:
// Check remote avatar size
    
if ($avatar) {
   
## INSERT HERE ## 
PHP Code:
   ## THIS IS WHAT YOU SHOULD INSERT ##
                
$size getimagesize($avatar);
                
$width $size[0];
                
$height $size[1];
            if (
$width $aw || $height $ah# WHY DOESN'T THIS TRIGGER?
                    
echo "?? WTF ?? NO TRIGGER HERE??"
Can you see? On one hand, it says that the avatar is too big, but on the other hand, the code which is placed a few lines above is exactly the same, but doesn't activate when the interpreter goes over the code?

WHY?? :S Weird!

Last edited by dezza; 23rd October 2008 at 06:09.
Reply With Quote