PHP Classes

valid_isbn() bug

Recommend this page to a friend!

      ISBN check  >  All threads  >  valid_isbn() bug  >  (Un) Subscribe thread alerts  
Subject:valid_isbn() bug
Summary:isset check always evaluates to TRUE
Author:Kashif Hisam
Date:2008-04-21 18:27:13
Update:2009-11-19 20:57:20


  1. valid_isbn() bug   Reply   Report abuse  
Picture of Kashif Hisam Kashif Hisam - 2008-04-21 18:27:13
In line 260, isset($this->gtin14), isset($this->isbn13) & isset($this->isbn10) always evaluates to TRUE, so the function will only work when given a gtin14 number. If isbn13 or isbn10 is given then function will fail. Maybe all isset() calls has to be removed from line 260

  2. Re: valid_isbn() bug   Reply   Report abuse  
Picture of Keith Nunn Keith Nunn - 2009-11-19 20:57:20 - In reply to message 1 from Kashif Hisam
It looks like the error is actually in the gtin-14 check. I've fixed that and the valid_isbn() function seems to work fine now. I'll upload the fix in a minute. Sorry for the long delay.