Last modified: 2006-12-18 01:14:03 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 8110 - ISBN-recognition fails on (older) ISBN divided by spaces
ISBN-recognition fails on (older) ISBN divided by spaces
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-12-01 02:00 UTC by Sebastiano
Modified: 2006-12-18 01:14 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Sebastiano 2006-12-01 02:00:43 UTC
Older ISBN may be internally divided by hyphens or spaces. The software
recognizes divisions by hyphen correctly but not ISBN divided by spaces.

If a space would be added to the string search (e. g. (regex) "ISBN
([0123456789-Xx ]+)" instead of (regex) "ISBN ([0123456789-Xx]+)") this bug
could be fixed.
Comment 1 Ilmari Karonen 2006-12-01 02:12:22 UTC
[[ISBN]] says both hyphens and spaces are valid, so I guess this should be
fixed.  But in the mean time, you could work around it by just using hyphens
instead -- it's not as if the choice delimiters actually means anything.
Comment 2 Ilmari Karonen 2006-12-01 02:41:35 UTC
Fixed in r18074.
Comment 3 JePe 2006-12-02 16:18:16 UTC
A hyphen with a space on each side is also sometimes used as a delimiter between
the ISBN and the other text on a line. So, a good fix shall also check that a
space and a hyphen may not occur next to each other in a link. For example:

ISBN 123456789 - 2005

In this case the year may not become a part of the ISBN link.
Comment 4 JePe 2006-12-18 00:40:14 UTC
The example above now makes a link for the ISBN including the year, so it looks
for ISBN 1234567892005 on Special:Booksources.

See [[User:JePe/temp]]
Comment 5 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-12-18 01:08:01 UTC
It could be expanded to

(?:[0-9]{3}[-\ ]?)?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9xX]

but that's quite a bit ickier than

[0-9Xx\ \-]+

I don't think it would make a noticeable difference to execution time, though.
Comment 6 Ilmari Karonen 2006-12-18 01:14:03 UTC
Fixed in r18415.  This change makes the magic ISBN detection much stricter; it
should still match all valid ISBNs, but there might be some breakage somewhere
if someone had previously relied on it matching invalid ones as well.

Note You need to log in before you can comment on or make changes to this bug.