Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-content
/
plugins
/
better-wp-security
/
core
/
admin-pages
/
entries
/
tools
:
utils.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/** * External dependencies */ import Ajv from 'ajv'; /** * Grabs a global instance of Ajv. * * @return {Ajv.Ajv} The ajv instance. */ export function getAjv() { if ( ! getAjv.instance ) { getAjv.instance = new Ajv( { schemaId: 'id' } ); getAjv.instance.addMetaSchema( require( 'ajv/lib/refs/json-schema-draft-04.json' ) ); getAjv.instance.addFormat( 'html', { type: 'string', validate() { // Validating HTML isn't something we can realistically do. // We accept everything and can then kses it on the server. return true; }, } ); } return getAjv.instance; }