Skip to content

Conversation

@GregMage
Copy link
Contributor

@GregMage GregMage commented Sep 3, 2025

Related to this point:
#1564

Xoops should not use the deprecated ‘addSlashes’ function in its core.

This PR fixes this error.

@mambax7 mambax7 requested a review from Copilot September 3, 2025 19:57
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 replaces deprecated addSlashes() function calls with the proper $xoopsDB->escape() method across multiple files in the XOOPS CMS core. The deprecated addSlashes() function from the MyTextSanitizer class is being replaced with the database-specific escaping method to improve security and follow modern practices.

Key changes:

  • Replace $myts->addSlashes() calls with $xoopsDB->escape() for proper SQL escaping
  • Remove unused $myts variable declarations where they're no longer needed
  • Add global $xoopsDB; declarations where the database object wasn't previously accessible

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
htdocs/search.php Replace addSlashes with escape for search query sanitization
htdocs/modules/system/admin/users/main.php Replace addSlashes with escape for email validation
htdocs/modules/profile/search.php Replace addSlashes with escape and remove unused $myts variable
htdocs/modules/profile/lostpass.php Replace addSlashes with escape and remove unused $myts variable
htdocs/modules/profile/edituser.php Replace addSlashes with escape for avatar handling
htdocs/modules/profile/activate.php Replace addSlashes with escape for email handling
htdocs/lostpass.php Replace addSlashes with escape for password recovery
htdocs/edituser.php Replace addSlashes with escape for user avatar processing
htdocs/class/xoopstopic.php Replace addSlashes with escape and update variable declarations
htdocs/class/xoopsstory.php Replace addSlashes with escape for story content handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mambax7 mambax7 merged commit 83aa0ae into XOOPS:master Sep 4, 2025
4 checks passed
@mambax7
Copy link
Collaborator

mambax7 commented Sep 4, 2025

Thank you!

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.

2 participants