thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/HTMLModule.php
public function parseContents($contents) {
        if (!is_string($contents)) return array(null, null); // defer
        switch ($contents) {
            // check for shorthand content model forms
            case 'Empty':
                return array('empty', '');
            case 'Inline':
                return array('optional', 'Inline | #PCDATA');
            case 'Flow':
                return array('optional', 'Flow | #PCDATA');
        }
        list($content_model_type, $content_model) = explode(':', $contents);
        $content_model_type = strtolower(trim($content_model_type));
        $content_model = trim($content_model);
        return array($content_model_type, $content_model);
    }
public function parseContents($contents) {
        if (!is_string($contents)) return array(null, null); // defer
        switch ($contents) {
            // check for shorthand content model forms
            case 'Empty':
                return array('empty', '');
            case 'Inline':
                return array('optional', 'Inline | #PCDATA');
            case 'Flow':
                return array('optional', 'Flow | #PCDATA');
        }
        list($content_model_type, $content_model) = explode(':', $contents);
        $content_model_type = strtolower(trim($content_model_type));
        $content_model = trim($content_model);
        return array($content_model_type, $content_model);
    }
public function parseContents ( $ contents ) { if ( ! is_string ( $ contents ) ) return array ( null , null ) ; // defer switch ( $ contents ) { // check for shorthand content model forms case 'Empty' : return array ( 'empty' , '' ) ; case 'Inline' : return array ( 'optional' , 'Inline | #PCDATA' ) ; case 'Flow' : return array ( 'optional' , 'Flow | #PCDATA' ) ; } list ( $ content_model_type , $ content_model ) = explode ( ':' , $ contents ) ; $ content_model_type = strtolower ( trim ( $ content_model_type ) ) ; $ content_model = trim ( $ content_model ) ; return array ( $ content_model_type , $ content_model ) ; }
Convenience function that transforms single-string contents
into separate content model and content model type
@param $contents Allowed children in form of:
"$content_model_type: $content_model"
@note If contents is an object, an array of two nulls will be
returned, and the callee needs to take the original $contents
and use it directly.
Convenience function that transforms single - string contents into separate content model and content model type