public/ckeditor/4.4dev/core/filter.js
function processProtectedElement( that, comment, protectedRegexs, filterOpts ) {
		var source = decodeURIComponent( comment.value.replace( /^\{cke_protected\}/, '' ) ),
			protectedFrag,
			toBeRemoved = [],
			node, i, match;

		// Protected element's and protected source's comments look exactly the same.
		// Check if what we have isn't a protected source instead of protected script/noscript.
		if ( protectedRegexs ) {
			for ( i = 0; i < protectedRegexs.length; ++i ) {
				if ( ( match = source.match( protectedRegexs[ i ] ) ) &&
					match[ 0 ].length == source.length	// Check whether this pattern matches entire source
														// to avoid '<script>alert("<? 1 ?>")</script>' matching
														// the PHP's protectedSource regexp.
				)
					return true;
			}
		}

		protectedFrag = CKEDITOR.htmlParser.fragment.fromHtml( source );

		if ( protectedFrag.children.length == 1 && ( node = protectedFrag.children[ 0 ] ).type == CKEDITOR.NODE_ELEMENT )
			processElement( that, node, toBeRemoved, filterOpts );

		// If protected element has been marked to be removed, return 'false' - comment was rejected.
		return !toBeRemoved.length;
	}
function processProtectedElement( that, comment, protectedRegexs, filterOpts ) {
		var source = decodeURIComponent( comment.value.replace( /^\{cke_protected\}/, '' ) ),
			protectedFrag,
			toBeRemoved = [],
			node, i, match;

		// Protected element's and protected source's comments look exactly the same.
		// Check if what we have isn't a protected source instead of protected script/noscript.
		if ( protectedRegexs ) {
			for ( i = 0; i < protectedRegexs.length; ++i ) {
				if ( ( match = source.match( protectedRegexs[ i ] ) ) &&
					match[ 0 ].length == source.length	// Check whether this pattern matches entire source
														// to avoid '<script>alert("<? 1 ?>")</script>' matching
														// the PHP's protectedSource regexp.
				)
					return true;
			}
		}

		protectedFrag = CKEDITOR.htmlParser.fragment.fromHtml( source );

		if ( protectedFrag.children.length == 1 && ( node = protectedFrag.children[ 0 ] ).type == CKEDITOR.NODE_ELEMENT )
			processElement( that, node, toBeRemoved, filterOpts );

		// If protected element has been marked to be removed, return 'false' - comment was rejected.
		return !toBeRemoved.length;
	}
function processProtectedElement ( that , comment , protectedRegexs , filterOpts ) { var source = decodeURIComponent ( comment . value . replace ( / ^\{cke_protected\} / , '' ) ) , protectedFrag , toBeRemoved = [ ] , node , i , match ; // Protected element's and protected source's comments look exactly the same. // Check if what we have isn't a protected source instead of protected script/noscript. if ( protectedRegexs ) { for ( i = 0 ; i < protectedRegexs . length ; ++ i ) { if ( ( match = source . match ( protectedRegexs [ i ] ) ) && match [ 0 ] . length == source . length // Check whether this pattern matches entire source // to avoid '<script>alert("<? 1 ?>")</script>' matching // the PHP's protectedSource regexp. ) return true ; } } protectedFrag = CKEDITOR . htmlParser . fragment . fromHtml ( source ) ; if ( protectedFrag . children . length == 1 && ( node = protectedFrag . children [ 0 ] ) . type == CKEDITOR . NODE_ELEMENT ) processElement ( that , node , toBeRemoved , filterOpts ) ; // If protected element has been marked to be removed, return 'false' - comment was rejected. return ! toBeRemoved . length ; }
Filter element protected with a comment. Returns true if protected content is ok, false otherwise.
Filter element protected with a comment . Returns true if protected content is ok false otherwise .