Skip to content

Commit

Permalink
fix for [[Special:Diff/1111242074]] et al.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Sep 20, 2022
1 parent 46a7aa5 commit 0ffae10
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions src/modules/ia/models/CopyrightProblemsListing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,18 @@ export default class CopyrightProblemsListing {
// This ensures we're always using the prefixedDb version of the title (as
// provided by the anchor) for stability.
const prefixedDb = anchor.getAttribute( 'id' );
const href = el.getAttribute( 'href' );
const title = anchorToTitle( el as HTMLAnchorElement );

if ( title === false ) {
// Not a valid link.
return false;
} else if ( title.getPrefixedText() !== new mw.Title( prefixedDb ).getPrefixedText() ) {
// Anchor and link mismatch. Someone tampered with the template?
// In this case, rely on the link instead, as the anchor is merely invisible.
console.warn( `Anchor and link mismatch for "${title.getPrefixedText()}".`, title, prefixedDb );
}

if ( title === false ) {
// Not a valid link.
return false;
} else if ( title.getPrefixedText() !== new mw.Title( prefixedDb ).getPrefixedText() ) {
// Anchor and link mismatch. Someone tampered with the template?
// In this case, rely on the link instead, as the anchor is merely invisible.
console.warn(
`Anchor and link mismatch for "${title.getPrefixedText()}".`, title, prefixedDb
);
}

// Checks for the <span class="plainlinks"> element.
// This ensures that the listing came from {{article-cv}} and isn't just a
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ia/ui/SinglePageWorkflowDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ function initSinglePageWorkflowDialog() {
const comments = `${
( from || '' ).trim().length !== 0 ? 'from ' + from + '. ' : ''
}${
this.data.notes
this.data.notes ?? ''
}`;

await CopyrightProblemsPage.getCurrent()
Expand Down

0 comments on commit 0ffae10

Please sign in to comment.