Make WordPress Core

Ticket #47216: 47216.1.patch

File 47216.1.patch, 452 bytes (added by splitti, 6 years ago)

Patches cleanForSlug to not fail when the parameter isn't a string.

  • packages/editor/src/utils/url.js

    diff --git a/packages/editor/src/utils/url.js b/packages/editor/src/utils/url.js
    index 371cdedc9..55e2bd384 100644
    a b export function getWPAdminURL( page, query ) { 
    3939 * @return {string} Processed string
    4040 */
    4141export function cleanForSlug( string ) {
     42        if ( ! string ) return;
    4243        return toLower( deburr( trim( string.replace( /[\s\./_]+/g, '-' ), '-' ) ) );
    4344}