mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Formatting: Don't make links inside <script>
and <style>
tags clickable.
Fixes #30162 Props ninos-ego, adamsilverstein Built from https://develop.svn.wordpress.org/trunk@35847 git-svn-id: http://core.svn.wordpress.org/trunk@35811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2ae5db3856
commit
8826804952
@ -2195,9 +2195,9 @@ function make_clickable( $text ) {
|
||||
$nested_code_pre = 0; // Keep track of how many levels link is nested inside <pre> or <code>
|
||||
foreach ( $textarr as $piece ) {
|
||||
|
||||
if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) )
|
||||
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 ) )
|
||||
$nested_code_pre++;
|
||||
elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre )
|
||||
elseif ( $nested_code_pre && ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) || '</script>' === strtolower( $piece ) || '</style>' === strtolower( $piece ) ) )
|
||||
$nested_code_pre--;
|
||||
|
||||
if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5-alpha-35846';
|
||||
$wp_version = '4.5-alpha-35847';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user