X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fviews%2Fsrc%2FPlugin%2Fviews%2FPluginBase.php;fp=web%2Fcore%2Fmodules%2Fviews%2Fsrc%2FPlugin%2Fviews%2FPluginBase.php;h=7c17d2bf9b71fdebda179431e591a664d784a331;hp=5f9c9788de31d547141fa5a319732b012b6955b4;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/modules/views/src/Plugin/views/PluginBase.php b/web/core/modules/views/src/Plugin/views/PluginBase.php index 5f9c9788d..7c17d2bf9 100644 --- a/web/core/modules/views/src/Plugin/views/PluginBase.php +++ b/web/core/modules/views/src/Plugin/views/PluginBase.php @@ -368,17 +368,17 @@ abstract class PluginBase extends ComponentPluginBase implements ContainerFactor // We need to validate tokens are valid Twig variables. Twig uses the // same variable naming rules as PHP. // @see http://php.net/manual/language.variables.basics.php - assert('preg_match(\'/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/\', $token) === 1', 'Tokens need to be valid Twig variables.'); + assert(preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $token) === 1, 'Tokens need to be valid Twig variables.'); $twig_tokens[$token] = $replacement; } else { $parts = explode('.', $token); $top = array_shift($parts); - assert('preg_match(\'/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/\', $top) === 1', 'Tokens need to be valid Twig variables.'); + assert(preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $top) === 1, 'Tokens need to be valid Twig variables.'); $token_array = [array_pop($parts) => $replacement]; foreach (array_reverse($parts) as $key) { // The key could also be numeric (array index) so allow that. - assert('is_numeric($key) || (preg_match(\'/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/\', $key) === 1)', 'Tokens need to be valid Twig variables.'); + assert(is_numeric($key) || preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $key) === 1, 'Tokens need to be valid Twig variables.'); $token_array = [$key => $token_array]; } if (!isset($twig_tokens[$top])) {