Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#1721 closed defect (bug) (fixed)

Move smilies to smilies_init() that hooks into init()

Reported by: asknight Owned by: rob1n
Milestone: 2.2 Priority: high
Severity: major Version: 1.2
Component: Administration Keywords: has-patch dev-feedback
Focuses: Cc:


vars.php calls get_settings() on 'siteurl' and 'home' which can both have filters defined, before filters are declared in the setup stream.

Can impact (and does in my case save for my hack) smilies, COOKIEPATH, and SITECOOKIEPATH. The last two potentially critical in setting user cookies properly.

Attachments (5)

1721.diff (1.2 KB) - added by Nazgul 9 years ago.
1721b.diff (1.3 KB) - added by Nazgul 9 years ago.
1721.3.diff (1.3 KB) - added by rob1n 9 years ago.
Patch refreshed.
1721.4.diff (1.8 KB) - added by rob1n 9 years ago.
1721.5.diff (5.4 KB) - added by markjaquith 9 years ago.
With Ryan's suggestion

Download all attachments as: .zip

Change History (14)

comment:1 @matt10 years ago

  • Milestone changed from 2.0 to 2.1

Not sure what the fix for this will be, delaying for next version.

@Nazgul9 years ago

comment:2 @Nazgul9 years ago

  • Keywords has-patch added

get_option('home') is no longer present, so that's no longer an issue.

get_option('siteurl') is only being used for generating the smiley search and replace arrays. By moving that partly out of vars.php and into wp-settings.php it won't get called until filters are declared.

comment:3 @Nazgul9 years ago

  • Keywords needs-patch added; has-patch removed

Due to recent changes in trunk the attached patch is no longer valid.

Before I fix it. I'll wait for #3201 to be committed first though.

@Nazgul9 years ago

comment:4 @Nazgul9 years ago

  • Keywords has-patch added; needs-patch removed

Patch refreshed.

comment:5 @matt9 years ago

  • Milestone changed from 2.1 to 2.2

@rob1n9 years ago

Patch refreshed.

comment:6 @rob1n9 years ago

  • Keywords dev-feedback added; vars.php cookies filters removed
  • Owner changed from anonymous to rob1n
  • Status changed from new to assigned

comment:7 @rob1n9 years ago

  • Summary changed from vars.php calls get_settings() on 'siteurl' and 'home' before filters applied to Move smilies to smilies_init() that hooks into init()

Okay, the plan is to move the smiley code (which is the only thing using get_option()) to a smilies_init() that hooks into init, and can be swapped out by a plugin.

@rob1n9 years ago

comment:8 @ryan9 years ago

Can we put $wpsmiliestrans in that function too and add a check at the top of the func to see if the use_smilies option is false. If it is false, return immediately and skip the overhead of setting up smilies for those who have chosen to turn it off.

@markjaquith9 years ago

With Ryan's suggestion

comment:9 @ryan9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [5032]) Move smilies init to function and trigger from init. Props rob1n. fixes #1721

Note: See TracTickets for help on using tickets.