Make WordPress Core


Ignore:
Timestamp:
07/15/2017 03:47:16 PM (8 years ago)
Author:
adamsilverstein
Message:

Move sanitizeText and stripTags from press this to wp.sanitize.

Introduce the wp.sanitize namespace and add two helpers for text sanitization. stripTags strips HTML tags from a string using regex.

Fixes #40635.

File:
1 edited

Legend:

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

    r41050 r41061  
    339339    ) );
    340340
     341    $scripts->add( 'wp-sanitize', "/wp-includes/js/wp-sanitize$suffix.js", array('jquery'), false, 1 );
     342
    341343    $scripts->add( 'wp-backbone', "/wp-includes/js/wp-backbone$suffix.js", array('backbone', 'wp-util'), false, 1 );
    342344
     
    577579        ) );
    578580
    579         $scripts->add( 'press-this', "/wp-admin/js/press-this$suffix.js", array( 'jquery', 'tags-box' ), false, 1 );
     581        $scripts->add( 'press-this', "/wp-admin/js/press-this$suffix.js", array( 'jquery', 'tags-box', 'wp-sanitize' ), false, 1 );
    580582        did_action( 'init' ) && $scripts->localize( 'press-this', 'pressThisL10n', array(
    581583            'newPost' => __( 'Title' ),
Note: See TracChangeset for help on using the changeset viewer.