WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#37815 closed defect (bug) (duplicate)

PHP Notice: Undefined variable: collate

Reported by: Hax Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7
Component: Database Keywords:
Focuses: Cc:

Description

Since the $collate is not defined.

If the none of the conditions are met the $collate variable is never set. This issue could also affect $charset. I am not getting a php notice for $charset just yet only for $collate.

https://core.trac.wordpress.org/browser/trunk/src/wp-includes/wp-db.php#L752

Change History (3)

#1 @kraftbj
3 years ago

There's no default option for $charset or $collate in that section if the defined( 'DB_COLLATE') check fails. I believe the expectation is that should be set in wp-config.php (and is by default).

#2 @Hax
3 years ago

yes, but the variables should still be set, either to Null or empty string. The notice is that the variables are not set. or DB_COLLATE should always be set some where I guess.

Last edited 3 years ago by Hax (previous) (diff)

#3 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the report, we're already tracking this issue in #37683.

Note: See TracTickets for help on using tickets.