Improve Special:BookSources validation and error messages
authorKunal Mehta <legoktm@member.fsf.org>
Sat, 15 Oct 2016 07:34:26 +0000 (00:34 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Sat, 15 Oct 2016 07:34:41 +0000 (00:34 -0700)
commit56c1f67c75daa8fdda7f07e2ec223331fd2da567
treeee3393b5b0a6a01d1d6013debdc9fe21a7c1d567
parent501fee469e748a0e771aab921bb64db52f0f4fd5
Improve Special:BookSources validation and error messages

Visiting Special:BookSources/invalid would not show any error message
because "invalid" would get stripped away by cleanIsbn(), and then
appear as the empty string.

Instead, first validate the provided ISBN (if any), and display the
error message if invalid. Then show the form and book details.

Tests included.

Also remove an unused variable.

Change-Id: I40b703eace956ebbcdc0a2c2986b2c10474dd1fd
includes/specials/SpecialBooksources.php
tests/phpunit/includes/specials/SpecialBooksourcesTest.php