Searching for ISBNs entered with dashes in them.

8 views
Skip to first unread message

John Miedema

unread,
Feb 2, 2011, 4:15:33 PM2/2/11
to openbook4wordpress
Peter Murray noticed that he could not find ISBNs that had been
created with dashes in them. Until now, it was assumed by OpenBook
that Open Library cleaned out dashes. This does not appear to be the
case.

I plan a fix, but if you need to solve this problem now, Peter's
workaround is as follows:

1. Look for this code in the OpenBook file openbook_openlibrary.php

<code>
//clean ISBN
$isbn = str_replace("-", "", $isbn); //dash - 13-digit ISBNs often
have one, but not used by Open Library
$isbn = str_replace(" ", "", $isbn); //spaces
$isbn = str_replace("'", "", $isbn); //single quote - prevent problems
with string concatenation
</code>

2. add the // comment marks before the line that cleans up dashes

<code>
//clean ISBN
//$isbn = str_replace("-", "", $isbn); //dash - 13-digit ISBNs often
have one, but not used by Open Library
$isbn = str_replace(" ", "", $isbn); //spaces
$isbn = str_replace("'", "", $isbn); //single quote - prevent problems
with string concatenation
</code>

Peter Murray

unread,
Feb 2, 2011, 4:29:14 PM2/2/11
to openbook4wordpress
Thanks for considering this fix to the code. There was a discussion
on the ol-tech mailing list that can be read in the web archives
starting at:

http://www.mail-archive.com/ol-...@archive.org/msg00374.html

Peter
Reply all
Reply to author
Forward
0 new messages