Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Yuna Scatari Edition (YSE) (http://www.bvlist.com/forumdisplay.php?f=22)
-   -   takeprofedit.php [Line 76-87] Too big error .. (http://www.bvlist.com/showthread.php?t=1243)

dezza 23rd October 2008 06:05

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!


All times are GMT +2. The time now is 18:41.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.