Make WordPress Core

Opened 21 years ago

Closed 21 years ago

#2221 closed defect (bug) (invalid)

Single quotes in user login breaks some MySQL queries

Reported by: majelbstoat Owned by:
Priority: normal Milestone:
Component: Administration Version: 2.0
Severity: normal Keywords: single quote user_login MySQL bg|has-patch
Cc: Focuses:

Description

One of my user logins has a single quote in it that causes MySQL errors in the pluggable function get_userdatabylogin(). It may also cause problems in other areas of the code, but I haven't come across them yet.

Adding slashes to sanitize_user() in functions-formatting.php seems to work.

Diff attached.

Attachments (1)

addslashes to sanitize_user.diff​ (442 bytes ) - added by majelbstoat 21 years ago.
Diff to add slashes to a sanitised username.

Download all attachments as: .zip

Change History (3)

@majelbstoat
21 years ago

Diff to add slashes to a sanitised username.

#1 @majelbstoat
21 years ago

  • Keywords bg|has-patch added

#2 @majelbstoat
21 years ago

  • Resolution → invalid
  • Status new → closed

Closing this bug. It was a bug in the calling plugin's code, not WordPress. Plugin authors, make sure you always call get_userdatabylogin() with a valid userlogin, not a user name!

Note: See TracTickets for help on using tickets.