Skip to content

Conversation

@robertatakenaka
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings October 28, 2025 13:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR corrects a function name from avoid_mismatched_p to avoid_mismatched_tags in the ISIS database paragraph retrieval code. The change reflects that the function handles mismatched HTML tags in general, not just paragraph tags specifically.

  • Updates function calls in fix_paragraphs() and fix_references() to use the correctly named function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

old_link = change.get("old_link")
new_link = change.get("new_link")
for node in self.tree.xpath(f".//a[@href={old_link}]|.//img[@src={old_link}]"):
for node in self.tree.xpath(f'.//a[@href="{old_link}"]|.//img[@src="{old_link}"]'):
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XPath injection vulnerability: old_link is directly interpolated into the XPath expression without sanitization. If old_link contains double quotes or special XPath characters, it could break the query or allow injection. Use XPath variables or sanitize the input by escaping special characters.

Suggested change
for node in self.tree.xpath(f'.//a[@href="{old_link}"]|.//img[@src="{old_link}"]'):
for node in self.tree.xpath('.//a[@href=$old_link]|.//img[@src=$old_link]', old_link=old_link):

Copilot uses AI. Check for mistakes.
@robertatakenaka robertatakenaka merged commit 364917d into scieloorg:main Oct 28, 2025
1 check passed
@robertatakenaka robertatakenaka changed the title Corrige nome de função avoid_mismatched_tags na obtenção de parágrafos da base isis Corrige erros na obtenção de parágrafos da base isis (nome de função e xpath de ativos digitais) Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant