Page MenuHomePhabricator

When an ISBN has an X where it should have a 0, Special:BookSources treats it as valid
Closed, ResolvedPublic

Description

I noticed this when checking old TODOs and reading the code. It is a bug arising in part from the use of PHP's loose equality (==) operator.

Steps to reproduce:

  1. Open https://en.wikipedia.org/wiki/Special:BookSources/1413304541
  2. Open https://en.wikipedia.org/wiki/Special:BookSources/141330454X
  3. Open https://en.wikipedia.org/wiki/Special:BookSources/1413304540

Actual results: #1 gives, "The given ISBN does not appear to be valid; check for errors copying from the original source." #2 and #3 give no error.

Expected results: both #1 and #2 should give that error message. Only #3 should give no error.


Version: 1.24rc
Severity: minor
URL: https://en.wikipedia.org/wiki/Special:BookSources/141330454X

Details

Reference
bz67021

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:35 AM
bzimport set Reference to bz67021.

Change 141654 had a related patch set uploaded by PleaseStand:
Special:BookSources: Correct ISBN-10 validation for numbers ending in X

https://gerrit.wikimedia.org/r/141654

Change 141654 merged by jenkins-bot:
Special:BookSources: Correct validation of ISBNs containing X

https://gerrit.wikimedia.org/r/141654

successfully merged