Mrandreyka367 / fluxcp

Automatically exported from code.google.com/p/fluxcp
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Undefined variable: itemType2 #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the product are you using? On what operating system?
SVN 1063
Lunix
PHP 5.3.6

Please provide any additional information below.

Seeing this a lot

[06-Sep-2011 22:09:51] PHP Notice:  Undefined variable: itemType2 in 
/cp/addons/itemdb/modules/itemdb/index.php on line 73

This is a customized itemdb I converted to an addon, my line 73 is this:

if ($itemType2 && is_numeric($itemType2) && (floatval($itemType2) == 
intval($itemType2))) {

There is a chance in the logic where that var would not be defined at that 
point, so I defined it up above like this: (show with lines above and below for 
clarity)

        if ($itemType && $itemType !== '-1') {
            $itemType2 = 0;
            if (count($itemTypeSplit = explode('-', $itemType)) == 2) {
                $itemType = $itemTypeSplit[0];
                $itemType2 = $itemTypeSplit[1];
            }

and I will see if the error continues.

Original issue reported on code.google.com by jtp10...@gmail.com on 7 Sep 2011 at 10:42

GoogleCodeExporter commented 8 years ago
This was fixed in r1064.

Original comment by Paradox924X on 6 Feb 2012 at 12:49