WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/09/2015 11:54:24 PM (6 years ago)
Author:
johnbillion
Message:

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

Fixes #30162
Props ninos-ego, adamsilverstein

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r35813 r35847  
    21962196    foreach ( $textarr as $piece ) {
    21972197
    2198         if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) )
     2198        if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) || preg_match( '|^<script[\s>]|i', $piece ) || preg_match( '|^<style[\s>]|i', $piece ) )
    21992199            $nested_code_pre++;
    2200         elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre )
     2200        elseif ( $nested_code_pre && ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) || '</script>' === strtolower( $piece ) || '</style>' === strtolower( $piece ) ) )
    22012201            $nested_code_pre--;
    22022202
Note: See TracChangeset for help on using the changeset viewer.