You are here

private function XmlEncoder::needsCdataWrapping in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Encoder/XmlEncoder.php \Symfony\Component\Serializer\Encoder\XmlEncoder::needsCdataWrapping()

Checks if a value contains any characters which would require CDATA wrapping.

Parameters

string $val:

Return value

bool

1 call to XmlEncoder::needsCdataWrapping()
XmlEncoder::selectNodeType in vendor/symfony/serializer/Encoder/XmlEncoder.php
Tests the value being passed and decide what sort of element to create.

File

vendor/symfony/serializer/Encoder/XmlEncoder.php, line 452

Class

XmlEncoder
Encodes XML data.

Namespace

Symfony\Component\Serializer\Encoder

Code

private function needsCdataWrapping($val) {
  return preg_match('/[<>&]/', $val);
}