src/Sulu/Component/Content/Types/TextEditor.php
private function validate($content, $locale)
    {
        $validation = $this->markupParser->validate($content, $locale);

        $regex = sprintf(self::INVALID_REGEX, $this->markupNamespace, $this->markupNamespace);
        foreach ($validation as $tag => $state) {
            if (false === strpos($tag, 'sulu-validation-state="' . $state . '"')) {
                $newTag = preg_replace($regex, '$1 sulu-validation-state="' . $state . '"$2', $tag);
                $content = str_replace($tag, $newTag, $content);
            }
        }

        return $content;
    }
private function validate($content, $locale)
    {
        $validation = $this->markupParser->validate($content, $locale);

        $regex = sprintf(self::INVALID_REGEX, $this->markupNamespace, $this->markupNamespace);
        foreach ($validation as $tag => $state) {
            if (false === strpos($tag, 'sulu-validation-state="' . $state . '"')) {
                $newTag = preg_replace($regex, '$1 sulu-validation-state="' . $state . '"$2', $tag);
                $content = str_replace($tag, $newTag, $content);
            }
        }

        return $content;
    }
private function validate ( $ content , $ locale ) { $ validation = $ this -> markupParser -> validate ( $ content , $ locale ) ; $ regex = sprintf ( self :: INVALID_REGEX , $ this -> markupNamespace , $ this -> markupNamespace ) ; foreach ( $ validation as $ tag => $ state ) { if ( false === strpos ( $ tag , 'sulu-validation-state="' . $ state . '"' ) ) { $ newTag = preg_replace ( $ regex , '$1 sulu-validation-state="' . $ state . '"$2' , $ tag ) ; $ content = str_replace ( $ tag , $ newTag , $ content ) ; } } return $ content ; }
Returns validated content.

@param string $content
@param string $locale

@return string
Returns validated content .