WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#30162 closed defect (bug) (fixed)

make_clickable - skip script & style tags

Reported by: Ninos Ego Owned by: johnbillion
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Formatting Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Description

Hey there,
the make_clickable function should also skip the script and style tags.

PS: I also moved the $nested_code_pre to the front of the elseif-request for better performance (really small improvement).

Attached my patch...

Attachments (3)

formatting.php.patch (1.0 KB) - added by Ninos Ego 6 years ago.
30162.diff (2.2 KB) - added by adamsilverstein 6 years ago.
Bring patch current, add a unit test
30162.2.diff (2.0 KB) - added by johnbillion 4 years ago.

Download all attachments as: .zip

Change History (12)

#1 @kpdesign
6 years ago

  • Keywords has-patch added

#2 @johnbillion
6 years ago

  • Keywords needs-unit-tests added

Tests please!

@adamsilverstein
6 years ago

Bring patch current, add a unit test

#3 @adamsilverstein
6 years ago

30162.diff:

  • Bring patch current
  • Adds a simple unit test verifying that links are no longer auto-linked inside script or style tags after applying the patch

#4 @adamsilverstein
6 years ago

  • Keywords dev-feedback added; needs-unit-tests removed

#5 @johnbillion
6 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release
  • Version trunk deleted

#6 @swissspidy
4 years ago

  • Keywords has-unit-tests added
  • Milestone changed from Future Release to 4.5

Patch still applies, tests pass. Addition makes sense to me.

@johnbillion
4 years ago

#7 follow-up: @johnbillion
4 years ago

  • Keywords commit added
  • Owner set to johnbillion
  • Status changed from new to accepted

30162.2.diff uses a data provider for its tests.

#8 @johnbillion
4 years ago

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

In 35847:

Formatting: Don't make links inside <script> and <style> tags clickable.

Fixes #30162
Props ninos-ego, adamsilverstein

#9 in reply to: ↑ 7 @adamsilverstein
4 years ago

Replying to johnbillion:

30162.2.diff uses a data provider for its tests.

@johnbillion - Love that data provider!

Thanks for adjusting and the reminder: I learned about that after writing these tests.

Note: See TracTickets for help on using tickets.