public static function wrapInCDATA($value)
    {
        if (empty($value)) {
            return $value;
        }

        $startRegExp = '/^' . preg_quote(CDATA_BEGIN) . '/';
        $endRegExp = '/' . preg_quote(CDATA_END) . '$/';

        if (!preg_match($startRegExp, $value)) {
            $value = CDATA_BEGIN . $value;
        }

        if (!preg_match($endRegExp, $value)) {
            $value .= CDATA_END;
        }

        return $value;
    }
public static function wrapInCDATA($value)
    {
        if (empty($value)) {
            return $value;
        }

        $startRegExp = '/^' . preg_quote(CDATA_BEGIN) . '/';
        $endRegExp = '/' . preg_quote(CDATA_END) . '$/';

        if (!preg_match($startRegExp, $value)) {
            $value = CDATA_BEGIN . $value;
        }

        if (!preg_match($endRegExp, $value)) {
            $value .= CDATA_END;
        }

        return $value;
    }
public static function wrapInCDATA ( $ value ) { if ( empty ( $ value ) ) { return $ value ; } $ startRegExp = '/^' . preg_quote ( CDATA_BEGIN ) . '/' ; $ endRegExp = '/' . preg_quote ( CDATA_END ) . '$/' ; if ( ! preg_match ( $ startRegExp , $ value ) ) { $ value = CDATA_BEGIN . $ value ; } if ( ! preg_match ( $ endRegExp , $ value ) ) { $ value .= CDATA_END ; } return $ value ; }
Wrap a value in CDATA tags for XSL output of non encoded data, only
if not already wrapped.

@since Symphony 2.3.2

@param string $value
The string to wrap in CDATA
@return string
The wrapped string
Wrap a value in CDATA tags for XSL output of non encoded data only if not already wrapped .