When running something like this:

$result = civicrm_api4('Event', 'get', [
    'select' => ['id'],
    'where' => [
        ['OR', [
                ['title', 'LIKE', $keyword],
                ['summary', 'LIKE', $keyword],
    'checkPermissions' => false,

Should the $keyword variable be escaped or is it something done internally by the API?

1 Answer 1


Yes, all strings will be escaped automatically by the CiviCRM code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.