Make WordPress Core

Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#30162 closed defect (bug) (fixed)

make_clickable - skip script & style tags

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


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 10 years ago.
30162.diff (2.2 KB) - added by adamsilverstein 9 years ago.
Bring patch current, add a unit test
30162.2.diff (2.0 KB) - added by johnbillion 8 years ago.

Download all attachments as: .zip

Change History (12)

#1 @kpdesign
10 years ago

  • Keywords has-patch added

#2 @johnbillion
10 years ago

  • Keywords needs-unit-tests added

Tests please!

9 years ago

Bring patch current, add a unit test

#3 @adamsilverstein
9 years ago


  • 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
9 years ago

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

#5 @johnbillion
9 years ago

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

#6 @swissspidy
8 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.

8 years ago

#7 follow-up: @johnbillion
8 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
8 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
8 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.