# eregi error

Subject: eregi error finds 979 anywhere in isbn 2 Nat Herold 2010-12-22 00:40:43 2012-02-28 18:04:56

 1. eregi error Reply Report abuse
Nat Herold - 2010-12-22 00:40:55
this:
if ( eregi("979", \$this->isbn13) )

needs to be changed; my suggestion is:

if ( preg_match("/^979.*?/", \$this->isbn13) )

otherwise it finds '979' anywhere in an isbn; e.g. throws an error if the isbn is a valid '9780393979213'

 2. Re: eregi error Reply Report abuse
Keith Nunn - 2012-02-28 18:04:56 - In reply to message 1 from Nat Herold
Thanks for the suggestion. I'll try to update the script soon. Sorry I haven't been paying much attention to it, I don't personally have any real use for it at present. I'll try to pay more attention to the forum here.

Keith

For more information send a message to `info at phpclasses dot org`.