WordPress.org

Make WordPress Core

Opened 11 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:

Description

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 10 years ago.
1721b.diff (1.3 KB) - added by Nazgul 10 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)

#1 @matt
11 years ago

  • Milestone changed from 2.0 to 2.1

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

@Nazgul
10 years ago

#2 @Nazgul
10 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.

#3 @Nazgul
10 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.

@Nazgul
10 years ago

#4 @Nazgul
10 years ago

  • Keywords has-patch added; needs-patch removed

Patch refreshed.

#5 @matt
10 years ago

  • Milestone changed from 2.1 to 2.2

@rob1n
9 years ago

Patch refreshed.

#6 @rob1n
9 years ago

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

#7 @rob1n
9 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.

@rob1n
9 years ago

#8 @ryan
9 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.

@markjaquith
9 years ago

With Ryan's suggestion

#9 @ryan
9 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.