tboothman / imdbphp

PHP library for retrieving film and tv information from IMDb
252 stars 85 forks source link

"Undefined variable" error in function get_gross #39

Closed dr-brown closed 8 years ago

dr-brown commented 8 years ago

Hello,

if no date is specified for the Gross value on the "Box office / business" page the function get_gross from title.php generates a "Undefined variable" error for $dateValue.

tboothman commented 8 years ago

Can you give an example of a film that does this?

IzzySoft commented 8 years ago

I guess that's due to three if conditions missing their else counterparts. Adding a simple $dateValue = NULL; (i.e. "declaring a default for fallback") before line 2410 should solve that.

dr-brown commented 8 years ago

Example: http://www.imdb.com/title/tt0056592

tboothman commented 8 years ago

A null probably seems like the best solution in this case. To kill a mockingbird had a year .. but there was only one gross so it didn't really matter. Goldfinger http://www.imdb.com/title/tt0058150/business has no year at all so no date needs to be accounted for.

tboothman commented 8 years ago

While I'm in here should I unformat the 'value' into a currency symbol and amount? If I were using it I think I'd want that .. but I'm not the one using it

dr-brown commented 8 years ago

I don't need a separation between symbol and amount.