Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37815 closed defect (bug) (duplicate)

PHP Notice: Undefined variable: collate

Reported by: hax's profile 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
8 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
8 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 8 years ago by Hax (previous) (diff)

#3 @SergeyBiryukov
8 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.