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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T10110, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 8110 - ISBN-recognition fails on (older) ISBN divided by spaces
ISBN-recognition fails on (older) ISBN divided by spaces
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://de.wikipedia.org/wiki/Benutzer...
:
Depends on:
Blocks:
  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: ---


Attachments

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.


Navigation
Links