regex.'/i'; preg_match_all($regex, $content, $matches); $tokens = []; if (count($matches[0])) { foreach ($matches[1] as $id) { $token = '{focus='.$id.'}'; $focus = $this->model->getEntity($id); if (null !== $focus && ( $focus->isPublished() || $this->security->hasEntityAccess( 'focus:items:viewown', 'focus:items:viewother', $focus->getCreatedBy() ) ) ) { $script = ''; $tokens[$token] = $script; } else { $tokens[$token] = ''; } } } return $tokens; } }