Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45506 closed defect (bug) (fixed)

wp_register_tinymce_scripts() provides incorrect arguments to includes_url()

Reported by: volodymyrkolesnykov's profile volodymyrkolesnykov Owned by: desrosj's profile desrosj
Milestone: 5.0.2 Priority: normal
Severity: normal Version: 5.0
Component: Script Loader Keywords: fixed-5.0 has-patch
Focuses: Cc:

Description

$scripts->add( 'wp-tinymce-lists', includes_url( "js/tinymce/plugins/lists/plugin$suffix.js", array( 'wp-tinymce' ), $tinymce_version ) );

should be

$scripts->add( 'wp-tinymce-lists', includes_url( "js/tinymce/plugins/lists/plugin$suffix.js" ), array( 'wp-tinymce' ), $tinymce_version );

Right now, array( 'wp-tinymce' ) is passed as $scheme argument to includes_url(), and according to the documentation, it should be either string or null, not an array.

Attachments (1)

45506.patch (614 bytes) - added by volodymyrkolesnykov 6 years ago.
Patch

Download all attachments as: .zip

Change History (9)

@volodymyrkolesnykov
6 years ago

Patch

#1 @volodymyrkolesnykov
6 years ago

  • Component changed from General to Script Loader
  • Keywords has-patch added

#2 @SergeyBiryukov
6 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 5.0.1

#3 @SergeyBiryukov
6 years ago

Hi @volodymyrkolesnykov, welcome to WordPress Trac!

Good catch, thanks for the report!

#4 @pento
6 years ago

  • Milestone changed from 5.0.1 to 5.0.2

#5 @desrosj
6 years ago

  • Owner set to desrosj
  • Status changed from new to assigned

#6 @desrosj
6 years ago

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

In 44211:

Script Loader: Misplaced parenthesis when wp-tinymce-lists is added.

A closing parenthesis was misplaced in the $scripts->add( 'wp-tinymce-lists' ) call, causing the dependencies and version to be incorrectly passed to includes_url() instead.

Props volodymyrkolesnykov.
Fixes: #45506.

#7 @desrosj
6 years ago

  • Keywords fixed-5.0 added; commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for merge into trunk.

#8 @desrosj
6 years ago

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

In 44308:

Script Loader: Misplaced parenthesis when wp-tinymce-lists is added.

A closing parenthesis was misplaced in the $scripts->add( 'wp-tinymce-lists' ) call, causing the dependencies and version to be incorrectly passed to includes_url() instead.

Also, Remove an incorrect parameter sent to wp_get_script_polyfill(). wp_get_script_polyfill() only accepts two parameters, but this call was passing a third.

Props volodymyrkolesnykov, swissspidy.

Merges [44208] and [44211] into trunk.

Fixes: #45506, #45472.

Note: See TracTickets for help on using tickets.