Remove whitespaces from vocabulary links, add dedicated exception for
lcsh links that are actually loc links
This commit is contained in:
@ -36,7 +36,7 @@ final class MDNodaLink {
|
||||
public function __construct(MDNodaRepository $source, string $id) {
|
||||
|
||||
$this->source = $source;
|
||||
if (($validatedId = $this->source->validateId(trim($id))) === false) {
|
||||
if (($validatedId = $this->source->validateId(strtr(trim($id), [" " => "", "\t" => "", "\n" => ""]))) === false) {
|
||||
throw new MDInvalidNodaLink("Invalid noda ID / link: \"" . $id . "\" [Repository: " . $this->source->toDbName() . "]");
|
||||
}
|
||||
$this->id = $validatedId;
|
||||
|
Reference in New Issue
Block a user